From a23a7572a2682cae2255c52583c2cef45d2eeb9b Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 10 Apr 2002 18:08:06 +0000 Subject: [PATCH] rename out qp's --- panda/src/builder/builder.cxx | 34 +- panda/src/builder/builder.h | 4 +- panda/src/builder/builderBucket.cxx | 26 +- panda/src/builder/builderBucket.h | 6 +- panda/src/builder/builderBucketNode.cxx | 4 +- panda/src/builder/builderBucketNode.h | 4 +- panda/src/builder/builderFuncs.I | 6 +- panda/src/builder/builderFuncs.h | 4 +- panda/src/builder/builderNormalVisualizer.cxx | 4 +- panda/src/builder/builderNormalVisualizer.h | 2 +- panda/src/chan/Sources.pp | 12 +- panda/src/chan/animBundle.h | 5 +- .../{qpanimBundleNode.I => animBundleNode.I} | 28 +- ...panimBundleNode.cxx => animBundleNode.cxx} | 34 +- .../{qpanimBundleNode.h => animBundleNode.h} | 20 +- panda/src/chan/animChannelMatrixXfmTable.cxx | 12 - panda/src/chan/animChannelScalarTable.cxx | 6 - panda/src/chan/animGroup.h | 9 +- panda/src/chan/auto_bind.cxx | 38 +- panda/src/chan/chan_composite1.cxx | 2 +- panda/src/chan/chan_composite2.cxx | 2 +- panda/src/chan/config_chan.cxx | 10 +- panda/src/chan/partBundle.I | 11 - panda/src/chan/partBundle.cxx | 10 +- panda/src/chan/partBundle.h | 5 +- .../{qppartBundleNode.I => partBundleNode.I} | 32 +- ...ppartBundleNode.cxx => partBundleNode.cxx} | 24 +- .../{qppartBundleNode.h => partBundleNode.h} | 20 +- panda/src/chan/partGroup.h | 12 +- panda/src/chancfg/chancfg.I | 12 +- panda/src/chancfg/chancfg.cxx | 18 +- panda/src/chancfg/chancfg.h | 8 +- panda/src/char/Sources.pp | 6 +- panda/src/char/char_composite1.cxx | 2 +- panda/src/char/{qpcharacter.I => character.I} | 36 +- .../char/{qpcharacter.cxx => character.cxx} | 162 ++-- panda/src/char/{qpcharacter.h => character.h} | 40 +- panda/src/char/characterJoint.cxx | 33 +- panda/src/char/characterJoint.h | 3 +- panda/src/char/characterJointBundle.I | 10 +- panda/src/char/characterJointBundle.h | 4 +- panda/src/char/computedVertices.cxx | 14 +- panda/src/char/computedVertices.h | 8 +- panda/src/char/config_char.cxx | 6 +- panda/src/collide/Sources.pp | 60 +- panda/src/collide/collide_composite1.cxx | 18 +- panda/src/collide/collide_composite2.cxx | 2 +- .../{qpcollisionEntry.I => collisionEntry.I} | 106 +- ...pcollisionEntry.cxx => collisionEntry.cxx} | 18 +- .../{qpcollisionEntry.h => collisionEntry.h} | 36 +- ...lisionHandler.cxx => collisionHandler.cxx} | 22 +- ...pcollisionHandler.h => collisionHandler.h} | 16 +- ...HandlerEvent.I => collisionHandlerEvent.I} | 40 +- ...lerEvent.cxx => collisionHandlerEvent.cxx} | 40 +- ...HandlerEvent.h => collisionHandlerEvent.h} | 40 +- ...HandlerFloor.I => collisionHandlerFloor.I} | 18 +- ...lerFloor.cxx => collisionHandlerFloor.cxx} | 38 +- ...HandlerFloor.h => collisionHandlerFloor.h} | 26 +- ...rPhysical.I => collisionHandlerPhysical.I} | 18 +- ...sical.cxx => collisionHandlerPhysical.cxx} | 88 +- ...rPhysical.h => collisionHandlerPhysical.h} | 50 +- ...ndlerPusher.I => collisionHandlerPusher.I} | 10 +- ...rPusher.cxx => collisionHandlerPusher.cxx} | 58 +- ...ndlerPusher.h => collisionHandlerPusher.h} | 26 +- ...lerQueue.cxx => collisionHandlerQueue.cxx} | 54 +- ...HandlerQueue.h => collisionHandlerQueue.h} | 30 +- ...sionLevelState.I => collisionLevelState.I} | 78 +- ...LevelState.cxx => collisionLevelState.cxx} | 26 +- ...sionLevelState.h => collisionLevelState.h} | 26 +- .../{qpcollisionNode.I => collisionNode.I} | 48 +- ...{qpcollisionNode.cxx => collisionNode.cxx} | 104 +- .../{qpcollisionNode.h => collisionNode.h} | 20 +- panda/src/collide/collisionPlane.cxx | 20 +- panda/src/collide/collisionPlane.h | 12 +- panda/src/collide/collisionPolygon.cxx | 26 +- panda/src/collide/collisionPolygon.h | 16 +- panda/src/collide/collisionRay.I | 6 +- panda/src/collide/collisionRay.cxx | 16 +- panda/src/collide/collisionRay.h | 10 +- panda/src/collide/collisionSegment.I | 6 +- panda/src/collide/collisionSegment.cxx | 16 +- panda/src/collide/collisionSegment.h | 10 +- panda/src/collide/collisionSolid.cxx | 20 +- panda/src/collide/collisionSolid.h | 30 +- panda/src/collide/collisionSphere.cxx | 24 +- panda/src/collide/collisionSphere.h | 16 +- ...lisionTraverser.I => collisionTraverser.I} | 2 +- ...onTraverser.cxx => collisionTraverser.cxx} | 178 ++-- ...lisionTraverser.h => collisionTraverser.h} | 60 +- panda/src/collide/config_collide.cxx | 34 +- panda/src/crgsg/crGraphicsStateGuardian.cxx | 26 +- panda/src/crgsg/crGraphicsStateGuardian.h | 6 +- panda/src/device/Sources.pp | 30 +- .../device/{qpanalogNode.I => analogNode.I} | 42 +- .../{qpanalogNode.cxx => analogNode.cxx} | 30 +- .../device/{qpanalogNode.h => analogNode.h} | 24 +- .../device/{qpbuttonNode.I => buttonNode.I} | 30 +- .../{qpbuttonNode.cxx => buttonNode.cxx} | 36 +- .../device/{qpbuttonNode.h => buttonNode.h} | 24 +- panda/src/device/config_device.cxx | 22 +- panda/src/device/device_composite2.cxx | 10 +- panda/src/device/{qpdialNode.I => dialNode.I} | 22 +- .../device/{qpdialNode.cxx => dialNode.cxx} | 24 +- panda/src/device/{qpdialNode.h => dialNode.h} | 24 +- panda/src/device/mouseAndKeyboard.cxx | 14 +- panda/src/device/mouseAndKeyboard.h | 12 +- .../device/{qptrackerNode.I => trackerNode.I} | 42 +- .../{qptrackerNode.cxx => trackerNode.cxx} | 24 +- .../device/{qptrackerNode.h => trackerNode.h} | 22 +- .../{qpvirtualMouse.cxx => virtualMouse.cxx} | 38 +- .../{qpvirtualMouse.h => virtualMouse.h} | 20 +- panda/src/dgraph/Sources.pp | 12 +- panda/src/dgraph/config_dgraph.cxx | 4 +- ...aGraphTraverser.I => dataGraphTraverser.I} | 6 +- ...phTraverser.cxx => dataGraphTraverser.cxx} | 50 +- ...aGraphTraverser.h => dataGraphTraverser.h} | 20 +- panda/src/dgraph/{qpdataNode.I => dataNode.I} | 22 +- .../dgraph/{qpdataNode.cxx => dataNode.cxx} | 52 +- panda/src/dgraph/{qpdataNode.h => dataNode.h} | 18 +- panda/src/dgraph/dgraph_composite1.cxx | 2 +- panda/src/dgraph/dgraph_composite2.cxx | 2 +- panda/src/display/config_display.cxx | 2 +- panda/src/display/config_display.h | 2 +- panda/src/display/displayRegion.I | 8 +- panda/src/display/displayRegion.cxx | 24 +- panda/src/display/displayRegion.h | 12 +- panda/src/display/geomNodeContext.I | 2 +- panda/src/display/geomNodeContext.h | 6 +- panda/src/display/graphicsEngine.cxx | 16 +- panda/src/display/graphicsEngine.h | 2 +- panda/src/display/graphicsStateGuardian.I | 4 +- panda/src/display/graphicsStateGuardian.cxx | 6 +- panda/src/display/graphicsStateGuardian.h | 6 +- panda/src/distort/nonlinearImager.I | 6 +- panda/src/distort/nonlinearImager.cxx | 30 +- panda/src/distort/nonlinearImager.h | 26 +- panda/src/distort/projectionScreen.I | 4 +- panda/src/distort/projectionScreen.cxx | 54 +- panda/src/distort/projectionScreen.h | 24 +- panda/src/dxgsg/dxGeomNodeContext.I | 2 +- panda/src/dxgsg/dxGeomNodeContext.h | 4 +- panda/src/dxgsg/dxGraphicsStateGuardian.cxx | 36 +- panda/src/dxgsg/dxGraphicsStateGuardian.h | 10 +- panda/src/dxgsg8/dxGeomNodeContext8.I | 2 +- panda/src/dxgsg8/dxGeomNodeContext8.h | 4 +- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 36 +- panda/src/dxgsg8/dxGraphicsStateGuardian8.h | 10 +- panda/src/egg2pg/Sources.pp | 15 +- panda/src/egg2pg/animBundleMaker.cxx | 10 +- panda/src/egg2pg/animBundleMaker.h | 4 +- ...pcharacterMaker.cxx => characterMaker.cxx} | 72 +- .../{qpcharacterMaker.h => characterMaker.h} | 20 +- panda/src/egg2pg/computedVerticesMaker.cxx | 6 +- panda/src/egg2pg/computedVerticesMaker.h | 6 +- panda/src/egg2pg/deferredNodeProperty.cxx | 6 +- panda/src/egg2pg/egg2pg_composite1.cxx | 2 +- panda/src/egg2pg/egg2pg_composite2.cxx | 4 +- .../egg2pg/{qpeggLoader.cxx => eggLoader.cxx} | 200 ++-- .../src/egg2pg/{qpeggLoader.h => eggLoader.h} | 29 +- panda/src/egg2pg/eggLoaderBase.h | 56 -- ...{qpload_egg_file.cxx => load_egg_file.cxx} | 20 +- .../{qpload_egg_file.h => load_egg_file.h} | 10 +- panda/src/egg2pg/loaderFileTypeEgg.cxx | 6 +- panda/src/egg2pg/loaderFileTypeEgg.h | 2 +- panda/src/framework/pandaFramework.I | 2 +- panda/src/framework/pandaFramework.cxx | 6 +- panda/src/framework/pandaFramework.h | 6 +- panda/src/framework/windowFramework.I | 2 +- panda/src/framework/windowFramework.cxx | 78 +- panda/src/framework/windowFramework.h | 34 +- panda/src/glgsg/glGeomNodeContext.I | 2 +- panda/src/glgsg/glGeomNodeContext.h | 4 +- panda/src/glgsg/glGraphicsStateGuardian.cxx | 38 +- panda/src/glgsg/glGraphicsStateGuardian.h | 10 +- panda/src/gobj/imageBuffer.cxx | 10 +- panda/src/gobj/imageBuffer.h | 9 +- panda/src/gobj/texture.cxx | 18 +- panda/src/gobj/texture.h | 14 +- panda/src/grutil/Sources.pp | 12 +- .../src/grutil/{qpcardMaker.I => cardMaker.I} | 46 +- .../grutil/{qpcardMaker.cxx => cardMaker.cxx} | 24 +- .../src/grutil/{qpcardMaker.h => cardMaker.h} | 16 +- panda/src/grutil/grutil_composite1.cxx | 4 +- panda/src/grutil/{qplineSegs.I => lineSegs.I} | 76 +- .../grutil/{qplineSegs.cxx => lineSegs.cxx} | 44 +- panda/src/grutil/{qplineSegs.h => lineSegs.h} | 22 +- panda/src/gsgbase/graphicsStateGuardianBase.h | 6 +- panda/src/loader/Sources.pp | 6 +- panda/src/loader/loader.I | 4 +- panda/src/loader/loader.cxx | 12 +- panda/src/loader/loader.h | 6 +- panda/src/loader/loaderFileType.cxx | 2 +- panda/src/loader/loaderFileType.h | 2 +- panda/src/loader/loaderFileTypeBam.cxx | 2 +- panda/src/loader/loaderFileTypeBam.h | 2 +- panda/src/loader/loader_composite2.cxx | 2 +- .../src/loader/{qpmodelPool.I => modelPool.I} | 42 +- .../loader/{qpmodelPool.cxx => modelPool.cxx} | 48 +- .../src/loader/{qpmodelPool.h => modelPool.h} | 16 +- panda/src/parametrics/nurbsCurveDrawer.h | 4 +- .../src/parametrics/parametricCurveDrawer.cxx | 10 +- panda/src/parametrics/parametricCurveDrawer.h | 10 +- .../src/particlesystem/baseParticleRenderer.I | 2 +- .../particlesystem/baseParticleRenderer.cxx | 4 +- .../src/particlesystem/baseParticleRenderer.h | 6 +- .../particlesystem/lineParticleRenderer.cxx | 2 +- panda/src/particlesystem/particleSystem.cxx | 12 +- .../particlesystem/pointParticleRenderer.cxx | 4 +- .../sparkleParticleRenderer.cxx | 4 +- .../particlesystem/spriteParticleRenderer.cxx | 10 +- .../particlesystem/spriteParticleRenderer.h | 4 +- panda/src/pgraph/Sources.pp | 108 +-- panda/src/pgraph/billboardEffect.I | 10 +- panda/src/pgraph/billboardEffect.cxx | 4 +- panda/src/pgraph/billboardEffect.h | 8 +- panda/src/pgraph/{qpcamera.I => camera.I} | 36 +- panda/src/pgraph/{qpcamera.cxx => camera.cxx} | 84 +- panda/src/pgraph/{qpcamera.h => camera.h} | 34 +- panda/src/pgraph/colorAttrib.h | 2 + panda/src/pgraph/colorScaleAttrib.h | 2 + panda/src/pgraph/config_pgraph.cxx | 80 +- panda/src/pgraph/config_pgraph.h | 2 +- panda/src/pgraph/cullBinAttrib.h | 2 + .../{qpcullTraverser.I => cullTraverser.I} | 66 +- ...{qpcullTraverser.cxx => cullTraverser.cxx} | 70 +- .../{qpcullTraverser.h => cullTraverser.h} | 20 +- panda/src/pgraph/cullTraverserData.I | 4 +- panda/src/pgraph/cullTraverserData.cxx | 6 +- panda/src/pgraph/cullTraverserData.h | 6 +- panda/src/pgraph/cullableObject.I | 2 +- panda/src/pgraph/cullableObject.h | 4 +- ...{qpfindApproxLevel.I => findApproxLevel.I} | 8 +- ...indApproxLevel.cxx => findApproxLevel.cxx} | 8 +- ...{qpfindApproxLevel.h => findApproxLevel.h} | 18 +- ...roxLevelEntry.I => findApproxLevelEntry.I} | 28 +- ...evelEntry.cxx => findApproxLevelEntry.cxx} | 34 +- ...roxLevelEntry.h => findApproxLevelEntry.h} | 40 +- .../{qpfindApproxPath.I => findApproxPath.I} | 64 +- ...pfindApproxPath.cxx => findApproxPath.cxx} | 54 +- .../{qpfindApproxPath.h => findApproxPath.h} | 24 +- panda/src/pgraph/{qpfog.I => fog.I} | 62 +- panda/src/pgraph/{qpfog.cxx => fog.cxx} | 84 +- panda/src/pgraph/{qpfog.h => fog.h} | 22 +- panda/src/pgraph/fogAttrib.I | 4 +- panda/src/pgraph/fogAttrib.cxx | 4 +- panda/src/pgraph/fogAttrib.h | 8 +- panda/src/pgraph/{qpgeomNode.I => geomNode.I} | 38 +- .../pgraph/{qpgeomNode.cxx => geomNode.cxx} | 120 +-- panda/src/pgraph/{qpgeomNode.h => geomNode.h} | 22 +- ...{qpgeomTransformer.I => geomTransformer.I} | 26 +- ...eomTransformer.cxx => geomTransformer.cxx} | 116 +-- ...{qpgeomTransformer.h => geomTransformer.h} | 30 +- panda/src/pgraph/{qplensNode.I => lensNode.I} | 18 +- .../pgraph/{qplensNode.cxx => lensNode.cxx} | 72 +- panda/src/pgraph/{qplensNode.h => lensNode.h} | 18 +- panda/src/pgraph/light.cxx | 6 +- panda/src/pgraph/light.h | 8 +- panda/src/pgraph/lightLensNode.cxx | 12 +- panda/src/pgraph/lightLensNode.h | 8 +- panda/src/pgraph/{qplodNode.I => lodNode.I} | 66 +- .../src/pgraph/{qplodNode.cxx => lodNode.cxx} | 76 +- panda/src/pgraph/{qplodNode.h => lodNode.h} | 20 +- .../src/pgraph/{qpmodelNode.I => modelNode.I} | 22 +- .../pgraph/{qpmodelNode.cxx => modelNode.cxx} | 61 +- .../src/pgraph/{qpmodelNode.h => modelNode.h} | 20 +- .../src/pgraph/{qpmodelRoot.I => modelRoot.I} | 18 +- .../pgraph/{qpmodelRoot.cxx => modelRoot.cxx} | 42 +- .../src/pgraph/{qpmodelRoot.h => modelRoot.h} | 24 +- panda/src/pgraph/{qpnodePath.I => nodePath.I} | 454 ++++----- .../pgraph/{qpnodePath.cxx => nodePath.cxx} | 906 +++++++++--------- panda/src/pgraph/{qpnodePath.h => nodePath.h} | 220 ++--- ...ePathCollection.I => nodePathCollection.I} | 12 +- ...hCollection.cxx => nodePathCollection.cxx} | 166 ++-- ...ePathCollection.h => nodePathCollection.h} | 44 +- ...odePathComponent.I => nodePathComponent.I} | 58 +- ...athComponent.cxx => nodePathComponent.cxx} | 72 +- ...odePathComponent.h => nodePathComponent.h} | 34 +- ...{qpnodePathLerps.cxx => nodePathLerps.cxx} | 104 +- .../{qpnodePathLerps.h => nodePathLerps.h} | 220 ++--- panda/src/pgraph/pandaNode.cxx | 88 +- panda/src/pgraph/pandaNode.h | 37 +- panda/src/pgraph/pgraph_composite1.cxx | 16 +- panda/src/pgraph/pgraph_composite2.cxx | 18 +- panda/src/pgraph/renderEffects.h | 1 + panda/src/pgraph/renderState.h | 1 + panda/src/pgraph/sceneGraphAnalyzer.cxx | 8 +- panda/src/pgraph/sceneGraphAnalyzer.h | 4 +- ...ceneGraphReducer.I => sceneGraphReducer.I} | 18 +- ...GraphReducer.cxx => sceneGraphReducer.cxx} | 84 +- ...ceneGraphReducer.h => sceneGraphReducer.h} | 22 +- panda/src/pgraph/sceneSetup.I | 12 +- panda/src/pgraph/sceneSetup.h | 22 +- .../{qpsequenceNode.I => sequenceNode.I} | 38 +- .../{qpsequenceNode.cxx => sequenceNode.cxx} | 74 +- .../{qpsequenceNode.h => sequenceNode.h} | 18 +- panda/src/pgraph/spotlight.cxx | 2 +- panda/src/pgraph/spotlight.h | 2 +- panda/src/pgraph/test_pgraph.cxx | 14 +- panda/src/pgraph/textureCollection.cxx | 4 +- panda/src/pgraph/transformState.h | 1 + panda/src/pgraph/workingNodePath.I | 10 +- panda/src/pgraph/workingNodePath.cxx | 8 +- panda/src/pgraph/workingNodePath.h | 12 +- panda/src/pgui/Sources.pp | 30 +- panda/src/pgui/config_pgui.cxx | 20 +- panda/src/pgui/{qppgButton.I => pgButton.I} | 32 +- .../src/pgui/{qppgButton.cxx => pgButton.cxx} | 100 +- panda/src/pgui/{qppgButton.h => pgButton.h} | 40 +- panda/src/pgui/pgCullTraverser.I | 4 +- panda/src/pgui/pgCullTraverser.h | 14 +- panda/src/pgui/{qppgEntry.I => pgEntry.I} | 128 +-- panda/src/pgui/{qppgEntry.cxx => pgEntry.cxx} | 190 ++-- panda/src/pgui/{qppgEntry.h => pgEntry.h} | 48 +- panda/src/pgui/pgFrameStyle.cxx | 44 +- panda/src/pgui/pgFrameStyle.h | 10 +- panda/src/pgui/{qppgItem.I => pgItem.I} | 190 ++-- panda/src/pgui/{qppgItem.cxx => pgItem.cxx} | 250 ++--- panda/src/pgui/{qppgItem.h => pgItem.h} | 48 +- panda/src/pgui/pgMouseWatcherBackground.cxx | 8 +- panda/src/pgui/pgMouseWatcherGroup.I | 8 +- panda/src/pgui/pgMouseWatcherGroup.cxx | 8 +- panda/src/pgui/pgMouseWatcherGroup.h | 8 +- panda/src/pgui/pgMouseWatcherRegion.cxx | 34 +- panda/src/pgui/pgMouseWatcherRegion.h | 8 +- panda/src/pgui/{qppgTop.I => pgTop.I} | 22 +- panda/src/pgui/{qppgTop.cxx => pgTop.cxx} | 50 +- panda/src/pgui/{qppgTop.h => pgTop.h} | 28 +- panda/src/pgui/{qppgWaitBar.I => pgWaitBar.I} | 30 +- .../pgui/{qppgWaitBar.cxx => pgWaitBar.cxx} | 56 +- panda/src/pgui/{qppgWaitBar.h => pgWaitBar.h} | 32 +- panda/src/pgui/pgui_composite1.cxx | 4 +- panda/src/pgui/pgui_composite2.cxx | 6 +- panda/src/physics/baseIntegrator.cxx | 14 +- panda/src/pnmimage/pnmFileType.h | 7 +- panda/src/putil/Sources.pp | 8 +- panda/src/putil/bam.h | 24 +- panda/src/putil/bamWriter.cxx | 1 + panda/src/putil/config_util.cxx | 2 - panda/src/putil/putil_composite2.cxx | 1 - panda/src/putil/typedWritable.h | 11 +- panda/src/putil/writable.I | 44 - panda/src/putil/writable.cxx | 32 - panda/src/putil/writable.h | 99 -- panda/src/testbed/pgrid.cxx | 8 +- panda/src/text/Sources.pp | 4 +- panda/src/text/config_text.cxx | 10 +- panda/src/text/staticTextFont.cxx | 6 +- panda/src/text/staticTextFont.h | 2 +- panda/src/text/{qptextNode.I => textNode.I} | 416 ++++---- .../src/text/{qptextNode.cxx => textNode.cxx} | 108 +-- panda/src/text/{qptextNode.h => textNode.h} | 16 +- panda/src/tform/Sources.pp | 30 +- ...{qpbuttonThrower.cxx => buttonThrower.cxx} | 108 +-- .../{qpbuttonThrower.h => buttonThrower.h} | 22 +- panda/src/tform/config_tform.cxx | 20 +- .../{qpdriveInterface.I => driveInterface.I} | 166 ++-- ...pdriveInterface.cxx => driveInterface.cxx} | 76 +- .../{qpdriveInterface.h => driveInterface.h} | 24 +- .../{qpmouseWatcher.I => mouseWatcher.I} | 130 +-- .../{qpmouseWatcher.cxx => mouseWatcher.cxx} | 126 +-- .../{qpmouseWatcher.h => mouseWatcher.h} | 32 +- panda/src/tform/mouseWatcherGroup.h | 1 - panda/src/tform/tform_composite1.cxx | 4 +- panda/src/tform/tform_composite2.cxx | 6 +- .../tform/{qptrackball.cxx => trackball.cxx} | 134 +-- .../src/tform/{qptrackball.h => trackball.h} | 30 +- .../{qptransform2sg.cxx => transform2sg.cxx} | 26 +- .../{qptransform2sg.h => transform2sg.h} | 20 +- 368 files changed, 6072 insertions(+), 6386 deletions(-) rename panda/src/chan/{qpanimBundleNode.I => animBundleNode.I} (73%) rename panda/src/chan/{qpanimBundleNode.cxx => animBundleNode.cxx} (84%) rename panda/src/chan/{qpanimBundleNode.h => animBundleNode.h} (82%) rename panda/src/chan/{qppartBundleNode.I => partBundleNode.I} (72%) rename panda/src/chan/{qppartBundleNode.cxx => partBundleNode.cxx} (86%) rename panda/src/chan/{qppartBundleNode.h => partBundleNode.h} (81%) rename panda/src/char/{qpcharacter.I => character.I} (75%) rename panda/src/char/{qpcharacter.cxx => character.cxx} (80%) rename panda/src/char/{qpcharacter.h => character.h} (78%) rename panda/src/collide/{qpcollisionEntry.I => collisionEntry.I} (79%) rename panda/src/collide/{qpcollisionEntry.cxx => collisionEntry.cxx} (84%) rename panda/src/collide/{qpcollisionEntry.h => collisionEntry.h} (81%) rename panda/src/collide/{qpcollisionHandler.cxx => collisionHandler.cxx} (82%) rename panda/src/collide/{qpcollisionHandler.h => collisionHandler.h} (83%) rename panda/src/collide/{qpcollisionHandlerEvent.I => collisionHandlerEvent.I} (86%) rename panda/src/collide/{qpcollisionHandlerEvent.cxx => collisionHandlerEvent.cxx} (87%) rename panda/src/collide/{qpcollisionHandlerEvent.h => collisionHandlerEvent.h} (67%) rename panda/src/collide/{qpcollisionHandlerFloor.I => collisionHandlerFloor.I} (84%) rename panda/src/collide/{qpcollisionHandlerFloor.cxx => collisionHandlerFloor.cxx} (82%) rename panda/src/collide/{qpcollisionHandlerFloor.h => collisionHandlerFloor.h} (73%) rename panda/src/collide/{qpcollisionHandlerPhysical.I => collisionHandlerPhysical.I} (73%) rename panda/src/collide/{qpcollisionHandlerPhysical.cxx => collisionHandlerPhysical.cxx} (71%) rename panda/src/collide/{qpcollisionHandlerPhysical.h => collisionHandlerPhysical.h} (58%) rename panda/src/collide/{qpcollisionHandlerPusher.I => collisionHandlerPusher.I} (82%) rename panda/src/collide/{qpcollisionHandlerPusher.cxx => collisionHandlerPusher.cxx} (82%) rename panda/src/collide/{qpcollisionHandlerPusher.h => collisionHandlerPusher.h} (70%) rename panda/src/collide/{qpcollisionHandlerQueue.cxx => collisionHandlerQueue.cxx} (77%) rename panda/src/collide/{qpcollisionHandlerQueue.h => collisionHandlerQueue.h} (70%) rename panda/src/collide/{qpcollisionLevelState.I => collisionLevelState.I} (80%) rename panda/src/collide/{qpcollisionLevelState.cxx => collisionLevelState.cxx} (92%) rename panda/src/collide/{qpcollisionLevelState.h => collisionLevelState.h} (84%) rename panda/src/collide/{qpcollisionNode.I => collisionNode.I} (85%) rename panda/src/collide/{qpcollisionNode.cxx => collisionNode.cxx} (85%) rename panda/src/collide/{qpcollisionNode.h => collisionNode.h} (88%) rename panda/src/collide/{qpcollisionTraverser.I => collisionTraverser.I} (94%) rename panda/src/collide/{qpcollisionTraverser.cxx => collisionTraverser.cxx} (81%) rename panda/src/collide/{qpcollisionTraverser.h => collisionTraverser.h} (60%) rename panda/src/device/{qpanalogNode.I => analogNode.I} (85%) rename panda/src/device/{qpanalogNode.cxx => analogNode.cxx} (88%) rename panda/src/device/{qpanalogNode.h => analogNode.h} (87%) rename panda/src/device/{qpbuttonNode.I => buttonNode.I} (86%) rename panda/src/device/{qpbuttonNode.cxx => buttonNode.cxx} (87%) rename panda/src/device/{qpbuttonNode.h => buttonNode.h} (85%) rename panda/src/device/{qpdialNode.I => dialNode.I} (84%) rename panda/src/device/{qpdialNode.cxx => dialNode.cxx} (88%) rename panda/src/device/{qpdialNode.h => dialNode.h} (84%) rename panda/src/device/{qptrackerNode.I => trackerNode.I} (78%) rename panda/src/device/{qptrackerNode.cxx => trackerNode.cxx} (89%) rename panda/src/device/{qptrackerNode.h => trackerNode.h} (85%) rename panda/src/device/{qpvirtualMouse.cxx => virtualMouse.cxx} (88%) rename panda/src/device/{qpvirtualMouse.h => virtualMouse.h} (86%) rename panda/src/dgraph/{qpdataGraphTraverser.I => dataGraphTraverser.I} (85%) rename panda/src/dgraph/{qpdataGraphTraverser.cxx => dataGraphTraverser.cxx} (84%) rename panda/src/dgraph/{qpdataGraphTraverser.h => dataGraphTraverser.h} (81%) rename panda/src/dgraph/{qpdataNode.I => dataNode.I} (85%) rename panda/src/dgraph/{qpdataNode.cxx => dataNode.cxx} (92%) rename panda/src/dgraph/{qpdataNode.h => dataNode.h} (93%) rename panda/src/egg2pg/{qpcharacterMaker.cxx => characterMaker.cxx} (89%) rename panda/src/egg2pg/{qpcharacterMaker.h => characterMaker.h} (87%) rename panda/src/egg2pg/{qpeggLoader.cxx => eggLoader.cxx} (93%) rename panda/src/egg2pg/{qpeggLoader.h => eggLoader.h} (86%) delete mode 100644 panda/src/egg2pg/eggLoaderBase.h rename panda/src/egg2pg/{qpload_egg_file.cxx => load_egg_file.cxx} (90%) rename panda/src/egg2pg/{qpload_egg_file.h => load_egg_file.h} (90%) rename panda/src/grutil/{qpcardMaker.I => cardMaker.I} (84%) rename panda/src/grutil/{qpcardMaker.cxx => cardMaker.cxx} (90%) rename panda/src/grutil/{qpcardMaker.h => cardMaker.h} (88%) rename panda/src/grutil/{qplineSegs.I => lineSegs.I} (85%) rename panda/src/grutil/{qplineSegs.cxx => lineSegs.cxx} (91%) rename panda/src/grutil/{qplineSegs.h => lineSegs.h} (87%) rename panda/src/loader/{qpmodelPool.I => modelPool.I} (86%) rename panda/src/loader/{qpmodelPool.cxx => modelPool.cxx} (83%) rename panda/src/loader/{qpmodelPool.h => modelPool.h} (92%) rename panda/src/pgraph/{qpcamera.I => camera.I} (86%) rename panda/src/pgraph/{qpcamera.cxx => camera.cxx} (80%) rename panda/src/pgraph/{qpcamera.h => camera.h} (81%) rename panda/src/pgraph/{qpcullTraverser.I => cullTraverser.I} (85%) rename panda/src/pgraph/{qpcullTraverser.cxx => cullTraverser.cxx} (90%) rename panda/src/pgraph/{qpcullTraverser.h => cullTraverser.h} (90%) rename panda/src/pgraph/{qpfindApproxLevel.I => findApproxLevel.I} (84%) rename panda/src/pgraph/{qpfindApproxLevel.cxx => findApproxLevel.cxx} (88%) rename panda/src/pgraph/{qpfindApproxLevel.h => findApproxLevel.h} (77%) rename panda/src/pgraph/{qpfindApproxLevelEntry.I => findApproxLevelEntry.I} (75%) rename panda/src/pgraph/{qpfindApproxLevelEntry.cxx => findApproxLevelEntry.cxx} (84%) rename panda/src/pgraph/{qpfindApproxLevelEntry.h => findApproxLevelEntry.h} (64%) rename panda/src/pgraph/{qpfindApproxPath.I => findApproxPath.I} (83%) rename panda/src/pgraph/{qpfindApproxPath.cxx => findApproxPath.cxx} (87%) rename panda/src/pgraph/{qpfindApproxPath.h => findApproxPath.h} (83%) rename panda/src/pgraph/{qpfog.I => fog.I} (90%) rename panda/src/pgraph/{qpfog.cxx => fog.cxx} (87%) rename panda/src/pgraph/{qpfog.h => fog.h} (92%) rename panda/src/pgraph/{qpgeomNode.I => geomNode.I} (87%) rename panda/src/pgraph/{qpgeomNode.cxx => geomNode.cxx} (85%) rename panda/src/pgraph/{qpgeomNode.h => geomNode.h} (90%) rename panda/src/pgraph/{qpgeomTransformer.I => geomTransformer.I} (70%) rename panda/src/pgraph/{qpgeomTransformer.cxx => geomTransformer.cxx} (79%) rename panda/src/pgraph/{qpgeomTransformer.h => geomTransformer.h} (82%) rename panda/src/pgraph/{qplensNode.I => lensNode.I} (78%) rename panda/src/pgraph/{qplensNode.cxx => lensNode.cxx} (81%) rename panda/src/pgraph/{qplensNode.h => lensNode.h} (88%) rename panda/src/pgraph/{qplodNode.I => lodNode.I} (81%) rename panda/src/pgraph/{qplodNode.cxx => lodNode.cxx} (84%) rename panda/src/pgraph/{qplodNode.h => lodNode.h} (88%) rename panda/src/pgraph/{qpmodelNode.I => modelNode.I} (83%) rename panda/src/pgraph/{qpmodelNode.cxx => modelNode.cxx} (80%) rename panda/src/pgraph/{qpmodelNode.h => modelNode.h} (85%) rename panda/src/pgraph/{qpmodelRoot.I => modelRoot.I} (78%) rename panda/src/pgraph/{qpmodelRoot.cxx => modelRoot.cxx} (76%) rename panda/src/pgraph/{qpmodelRoot.h => modelRoot.h} (81%) rename panda/src/pgraph/{qpnodePath.I => nodePath.I} (78%) rename panda/src/pgraph/{qpnodePath.cxx => nodePath.cxx} (86%) rename panda/src/pgraph/{qpnodePath.h => nodePath.h} (72%) rename panda/src/pgraph/{qpnodePathCollection.I => nodePathCollection.I} (83%) rename panda/src/pgraph/{qpnodePathCollection.cxx => nodePathCollection.cxx} (73%) rename panda/src/pgraph/{qpnodePathCollection.h => nodePathCollection.h} (61%) rename panda/src/pgraph/{qpnodePathComponent.I => nodePathComponent.I} (72%) rename panda/src/pgraph/{qpnodePathComponent.cxx => nodePathComponent.cxx} (79%) rename panda/src/pgraph/{qpnodePathComponent.h => nodePathComponent.h} (78%) rename panda/src/pgraph/{qpnodePathLerps.cxx => nodePathLerps.cxx} (67%) rename panda/src/pgraph/{qpnodePathLerps.h => nodePathLerps.h} (70%) rename panda/src/pgraph/{qpsceneGraphReducer.I => sceneGraphReducer.I} (73%) rename panda/src/pgraph/{qpsceneGraphReducer.cxx => sceneGraphReducer.cxx} (93%) rename panda/src/pgraph/{qpsceneGraphReducer.h => sceneGraphReducer.h} (89%) rename panda/src/pgraph/{qpsequenceNode.I => sequenceNode.I} (83%) rename panda/src/pgraph/{qpsequenceNode.cxx => sequenceNode.cxx} (81%) rename panda/src/pgraph/{qpsequenceNode.h => sequenceNode.h} (86%) rename panda/src/pgui/{qppgButton.I => pgButton.I} (79%) rename panda/src/pgui/{qppgButton.cxx => pgButton.cxx} (83%) rename panda/src/pgui/{qppgButton.h => pgButton.h} (73%) rename panda/src/pgui/{qppgEntry.I => pgEntry.I} (84%) rename panda/src/pgui/{qppgEntry.cxx => pgEntry.cxx} (88%) rename panda/src/pgui/{qppgEntry.h => pgEntry.h} (84%) rename panda/src/pgui/{qppgItem.I => pgItem.I} (79%) rename panda/src/pgui/{qppgItem.cxx => pgItem.cxx} (85%) rename panda/src/pgui/{qppgItem.h => pgItem.h} (86%) rename panda/src/pgui/{qppgTop.I => pgTop.I} (84%) rename panda/src/pgui/{qppgTop.cxx => pgTop.cxx} (84%) rename panda/src/pgui/{qppgTop.h => pgTop.h} (82%) rename panda/src/pgui/{qppgWaitBar.I => pgWaitBar.I} (84%) rename panda/src/pgui/{qppgWaitBar.cxx => pgWaitBar.cxx} (84%) rename panda/src/pgui/{qppgWaitBar.h => pgWaitBar.h} (75%) delete mode 100644 panda/src/putil/writable.I delete mode 100644 panda/src/putil/writable.cxx delete mode 100644 panda/src/putil/writable.h rename panda/src/text/{qptextNode.I => textNode.I} (83%) rename panda/src/text/{qptextNode.cxx => textNode.cxx} (94%) rename panda/src/text/{qptextNode.h => textNode.h} (97%) rename panda/src/tform/{qpbuttonThrower.cxx => buttonThrower.cxx} (84%) rename panda/src/tform/{qpbuttonThrower.h => buttonThrower.h} (88%) rename panda/src/tform/{qpdriveInterface.I => driveInterface.I} (80%) rename panda/src/tform/{qpdriveInterface.cxx => driveInterface.cxx} (91%) rename panda/src/tform/{qpdriveInterface.h => driveInterface.h} (92%) rename panda/src/tform/{qpmouseWatcher.I => mouseWatcher.I} (85%) rename panda/src/tform/{qpmouseWatcher.cxx => mouseWatcher.cxx} (92%) rename panda/src/tform/{qpmouseWatcher.h => mouseWatcher.h} (89%) rename panda/src/tform/{qptrackball.cxx => trackball.cxx} (88%) rename panda/src/tform/{qptrackball.h => trackball.h} (87%) rename panda/src/tform/{qptransform2sg.cxx => transform2sg.cxx} (86%) rename panda/src/tform/{qptransform2sg.h => transform2sg.h} (81%) diff --git a/panda/src/builder/builder.cxx b/panda/src/builder/builder.cxx index 66818e05cf..7dd88af373 100644 --- a/panda/src/builder/builder.cxx +++ b/panda/src/builder/builder.cxx @@ -22,7 +22,7 @@ #include "pmap.h" #include "builder.h" #include "pandaNode.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "dcast.h" //////////////////////////////////////////////////////////////////// @@ -66,12 +66,12 @@ Builder:: // with the same Node pointer have different names, then they should // be given two different GeomNodes. -class qpNodeMap : public Namable { +class NodeMap : public Namable { public: - qpNodeMap(PandaNode *node, const BuilderBucket *bucket) + NodeMap(PandaNode *node, const BuilderBucket *bucket) : _node(node), _bucket(bucket) { } - bool operator < (const qpNodeMap &other) const { + bool operator < (const NodeMap &other) const { if (_node != other._node) { return _node < other._node; } @@ -113,9 +113,9 @@ public: // have different names, then two different GeomNodes // are created, one with each name. //////////////////////////////////////////////////////////////////// -qpGeomNode *Builder:: -qpbuild(const string &default_name) { - typedef pmap GeomNodeMap; +GeomNode *Builder:: +build(const string &default_name) { + typedef pmap GeomNodeMap; GeomNodeMap geom_nodes; // First, build all the Geoms and create GeomNodes for them. Each @@ -126,15 +126,15 @@ qpbuild(const string &default_name) { i != _buckets.end(); ++i) { BuilderBucket *bucket = (*i).get_bucket(); - PandaNode *node = bucket->_qpnode; + PandaNode *node = bucket->_node; // const string &name = bucket->get_name(); - qpGeomNode *geom_node = NULL; + GeomNode *geom_node = NULL; - if (node!=NULL && node->is_of_type(qpGeomNode::get_class_type())) { + if (node!=NULL && node->is_of_type(GeomNode::get_class_type())) { // The node is a GeomNode. In this case, we simply use that // node. We can't separate them out by name in this case; we'll // just assign to it the first nonempty name we encounter. - geom_node = DCAST(qpGeomNode, node); + geom_node = DCAST(GeomNode, node); // Since the caller already created this GeomNode and passed it // in, we'll leave it up to the caller to name the node and set @@ -142,15 +142,15 @@ qpbuild(const string &default_name) { } else { // The node is not a GeomNode, so look it up in the map. - GeomNodeMap::iterator f = geom_nodes.find(qpNodeMap(node, bucket)); + GeomNodeMap::iterator f = geom_nodes.find(NodeMap(node, bucket)); if (f != geom_nodes.end()) { geom_node = (*f).second; } else { // No such node/name combination. Create a new one. - geom_node = bucket->qpmake_geom_node(); + geom_node = bucket->make_geom_node(); if (geom_node != NULL) { - geom_nodes[qpNodeMap(node, bucket)] = geom_node; + geom_nodes[NodeMap(node, bucket)] = geom_node; } } } @@ -164,15 +164,15 @@ qpbuild(const string &default_name) { // group nodes. Save out the geom_node associated with a NULL Node; // this one is returned from this function. - qpGeomNode *base_geom_node = NULL; + GeomNode *base_geom_node = NULL; GeomNodeMap::iterator gi; for (gi = geom_nodes.begin(); gi != geom_nodes.end(); ++gi) { - const qpNodeMap &nm = (*gi).first; - qpGeomNode *geom_node = (*gi).second; + const NodeMap &nm = (*gi).first; + GeomNode *geom_node = (*gi).second; PandaNode *node = nm._node; const string &name = nm._bucket->get_name(); diff --git a/panda/src/builder/builder.h b/panda/src/builder/builder.h index 927379832c..4bce51599f 100644 --- a/panda/src/builder/builder.h +++ b/panda/src/builder/builder.h @@ -175,7 +175,7 @@ #include "pset.h" -class qpGeomNode; +class GeomNode; /////////////////////////////////////////////////////////////////// @@ -195,7 +195,7 @@ public: INLINE bool add_prim_nonindexed(const BuilderBucket &bucket, const BuilderPrimI &prim); - qpGeomNode *qpbuild(const string &default_name = ""); + GeomNode *build(const string &default_name = ""); protected: void add_bucket(const BuilderBucket &bucket); diff --git a/panda/src/builder/builderBucket.cxx b/panda/src/builder/builderBucket.cxx index 1f26279d2d..854e9dbb46 100644 --- a/panda/src/builder/builderBucket.cxx +++ b/panda/src/builder/builderBucket.cxx @@ -21,7 +21,7 @@ #include "builderBucket.h" #include "builderFuncs.h" #include "builderMisc.h" -#include "qpgeomNode.h" +#include "geomNode.h" BuilderBucket *BuilderBucket::_default_bucket = NULL; @@ -34,7 +34,7 @@ BuilderBucket *BuilderBucket::_default_bucket = NULL; //////////////////////////////////////////////////////////////////// BuilderBucket:: BuilderBucket() { - _qpnode = NULL; + _node = NULL; (*this) = (*get_default_bucket()); } @@ -46,7 +46,7 @@ BuilderBucket() { //////////////////////////////////////////////////////////////////// BuilderBucket:: BuilderBucket(const BuilderBucket ©) { - _qpnode = NULL; + _node = NULL; (*this) = copy; } @@ -67,7 +67,7 @@ operator = (const BuilderBucket ©) { set_texcoords(copy._texcoords); set_colors(copy._colors); - _qpnode = copy._qpnode; + _node = copy._node; _drawBin = copy._drawBin; _drawOrder = copy._drawOrder; @@ -103,7 +103,7 @@ make_copy() const { //////////////////////////////////////////////////////////////////// -// Function: BuilderBucket::qpmake_geom_node +// Function: BuilderBucket::make_geom_node // Access: Public, Virtual // Description: Called by the builder when it is time to create a new // GeomNode. This function should allocate and return a @@ -111,9 +111,9 @@ make_copy() const { // may redefine it to return a subclass of GeomNode, or // to do some initialization to the node. //////////////////////////////////////////////////////////////////// -qpGeomNode *BuilderBucket:: -qpmake_geom_node() { - return new qpGeomNode(""); +GeomNode *BuilderBucket:: +make_geom_node() { + return new GeomNode(""); } //////////////////////////////////////////////////////////////////// @@ -163,8 +163,8 @@ operator < (const BuilderBucket &other) const { return get_name() < other.get_name(); } - if (_qpnode != other._qpnode) { - return _qpnode < other._qpnode; + if (_node != other._node) { + return _node < other._node; } if (_coords != other._coords) @@ -197,8 +197,8 @@ void BuilderBucket:: output(ostream &out) const { out << "Bucket \"" << get_name() << "\""; - if (_qpnode != (PandaNode *)NULL) { - out << " attached to " << *_qpnode << "\n"; + if (_node != (PandaNode *)NULL) { + out << " attached to " << *_node << "\n"; } out << "\n"; @@ -245,7 +245,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// BuilderBucket:: BuilderBucket(int) { - _qpnode = NULL; + _node = NULL; _drawBin = -1; _drawOrder = 0; diff --git a/panda/src/builder/builderBucket.h b/panda/src/builder/builderBucket.h index 965dbfe975..e1a5d646d3 100644 --- a/panda/src/builder/builderBucket.h +++ b/panda/src/builder/builderBucket.h @@ -36,7 +36,7 @@ class Geom; class PandaNode; -class qpGeomNode; +class GeomNode; /////////////////////////////////////////////////////////////////// // Class : BuilderBucket @@ -64,7 +64,7 @@ public: virtual ~BuilderBucket(); virtual BuilderBucket *make_copy() const; - virtual qpGeomNode *qpmake_geom_node(); + virtual GeomNode *make_geom_node(); virtual Geom *done_geom(Geom *geom); void add_attrib(const RenderAttrib *attrib); @@ -86,7 +86,7 @@ public: virtual void output(ostream &out) const; - PandaNode *_qpnode; + PandaNode *_node; short _drawBin; unsigned int _drawOrder; diff --git a/panda/src/builder/builderBucketNode.cxx b/panda/src/builder/builderBucketNode.cxx index e04fe88f00..8f0e5b600d 100644 --- a/panda/src/builder/builderBucketNode.cxx +++ b/panda/src/builder/builderBucketNode.cxx @@ -19,7 +19,7 @@ #include "builderFuncs.h" #include "builderBucketNode.h" -#include "qpgeomNode.h" +#include "geomNode.h" //////////////////////////////////////////////////////////////////// // Function: BuilderBucketNode::add_prim @@ -58,7 +58,7 @@ add_prim(const BuilderPrimI &prim) { // Returns the number of Geoms created. //////////////////////////////////////////////////////////////////// int BuilderBucketNode:: -build(qpGeomNode *geom_node) const { +build(GeomNode *geom_node) const { int count = 0; { diff --git a/panda/src/builder/builderBucketNode.h b/panda/src/builder/builderBucketNode.h index cf7d6cca0c..52f64a0931 100644 --- a/panda/src/builder/builderBucketNode.h +++ b/panda/src/builder/builderBucketNode.h @@ -27,7 +27,7 @@ #include "pset.h" class GeomNode; -class qpGeomNode; +class GeomNode; /////////////////////////////////////////////////////////////////// @@ -57,7 +57,7 @@ public: INLINE bool operator == (const BuilderBucketNode &other) const; INLINE bool operator != (const BuilderBucketNode &other) const; - int build(qpGeomNode *geom_node) const; + int build(GeomNode *geom_node) const; protected: typedef pmultiset > Prims; diff --git a/panda/src/builder/builderFuncs.I b/panda/src/builder/builderFuncs.I index 8a05b9616c..010026f575 100644 --- a/panda/src/builder/builderFuncs.I +++ b/panda/src/builder/builderFuncs.I @@ -487,7 +487,7 @@ expand(const PrimType &prim, BuilderBucket &bucket, OutputIterator result) { template static int build_geoms(InputIterator first, InputIterator last, - BuilderBucket &bucket, qpGeomNode *geom_node, + BuilderBucket &bucket, GeomNode *geom_node, PrimType *) { if (first==last) { return 0; @@ -797,7 +797,7 @@ public: template static int __mesh_and_build(InputIterator first, InputIterator last, - BuilderBucket &bucket, qpGeomNode *geom_node, + BuilderBucket &bucket, GeomNode *geom_node, PrimType *) { if (first==last) { return 0; @@ -880,7 +880,7 @@ __mesh_and_build(InputIterator first, InputIterator last, template int mesh_and_build(InputIterator first, InputIterator last, - BuilderBucket &bucket, qpGeomNode *geom_node, + BuilderBucket &bucket, GeomNode *geom_node, value_type *value_type_ptr) { return __mesh_and_build(first, last, bucket, geom_node, value_type_ptr); } diff --git a/panda/src/builder/builderFuncs.h b/panda/src/builder/builderFuncs.h index f6827fc637..cf468df366 100644 --- a/panda/src/builder/builderFuncs.h +++ b/panda/src/builder/builderFuncs.h @@ -22,7 +22,7 @@ #include "pvector.h" class BuilderBucket; -class qpGeomNode; +class GeomNode; //////////////////////////////////////////////////////////////////// @@ -57,7 +57,7 @@ expand(const PrimType &prim, BuilderBucket &bucket, template int mesh_and_build(InputIterator first, InputIterator last, - BuilderBucket &bucket, qpGeomNode *geom_node); + BuilderBucket &bucket, GeomNode *geom_node); diff --git a/panda/src/builder/builderNormalVisualizer.cxx b/panda/src/builder/builderNormalVisualizer.cxx index 860182b1fb..de5e718edd 100644 --- a/panda/src/builder/builderNormalVisualizer.cxx +++ b/panda/src/builder/builderNormalVisualizer.cxx @@ -18,7 +18,7 @@ #include "builderFuncs.h" #include "builderNormalVisualizer.h" -#include "qpgeomNode.h" +#include "geomNode.h" #ifdef SUPPORT_SHOW_NORMALS @@ -57,7 +57,7 @@ add_prim(const BuilderPrimI &prim) { } void BuilderNormalVisualizer:: -show_normals(qpGeomNode *node) { +show_normals(GeomNode *node) { // Ok, now we've got a bunch of normals saved up; create some geometry. mesh_and_build(_lines.begin(), _lines.end(), _bucket, node, (BuilderPrim *)0); } diff --git a/panda/src/builder/builderNormalVisualizer.h b/panda/src/builder/builderNormalVisualizer.h index d8823f6e1a..f269fe56d0 100644 --- a/panda/src/builder/builderNormalVisualizer.h +++ b/panda/src/builder/builderNormalVisualizer.h @@ -47,7 +47,7 @@ public: void add_prim(const BuilderPrim &prim); void add_prim(const BuilderPrimI &prim); - void show_normals(qpGeomNode *node); + void show_normals(GeomNode *node); private: void add_normal(const BuilderV ¢er, const BuilderN &normal); diff --git a/panda/src/chan/Sources.pp b/panda/src/chan/Sources.pp index 24e3c96a44..0a9935f4de 100644 --- a/panda/src/chan/Sources.pp +++ b/panda/src/chan/Sources.pp @@ -10,7 +10,7 @@ #define SOURCES \ animBundle.I animBundle.h \ - qpanimBundleNode.I qpanimBundleNode.h \ + animBundleNode.I animBundleNode.h \ animChannel.I animChannel.h animChannelBase.I \ animChannelBase.h animChannelMatrixXfmTable.I \ animChannelMatrixXfmTable.h animChannelScalarTable.I \ @@ -20,25 +20,25 @@ config_chan.h movingPartBase.I movingPartBase.h \ movingPartMatrix.I movingPartMatrix.h movingPartScalar.I \ movingPartScalar.h partBundle.I partBundle.N partBundle.h \ - qppartBundleNode.I qppartBundleNode.h \ + partBundleNode.I partBundleNode.h \ partGroup.I partGroup.h \ vector_PartGroupStar.h #define INCLUDED_SOURCES \ animBundle.cxx \ - qpanimBundleNode.cxx \ + animBundleNode.cxx \ animChannel.cxx \ animChannelBase.cxx animChannelMatrixXfmTable.cxx \ animChannelScalarTable.cxx animControl.cxx \ animControlCollection.cxx animGroup.cxx auto_bind.cxx \ config_chan.cxx movingPartBase.cxx movingPartMatrix.cxx \ movingPartScalar.cxx partBundle.cxx \ - qppartBundleNode.cxx \ + partBundleNode.cxx \ partGroup.cxx vector_PartGroupStar.cxx #define INSTALL_HEADERS \ animBundle.I animBundle.h \ - qpanimBundleNode.I qpanimBundleNode.h \ + animBundleNode.I animBundleNode.h \ animChannel.I animChannel.h animChannelBase.I animChannelBase.h \ animChannelFixed.I animChannelFixed.h animChannelMatrixXfmTable.I \ animChannelMatrixXfmTable.h animChannelScalarTable.I \ @@ -48,7 +48,7 @@ movingPart.I movingPart.h movingPartBase.I \ movingPartBase.h movingPartMatrix.I movingPartMatrix.h \ movingPartScalar.I movingPartScalar.h partBundle.I partBundle.h \ - qppartBundleNode.I qppartBundleNode.h \ + partBundleNode.I partBundleNode.h \ partGroup.I partGroup.h \ vector_PartGroupStar.h diff --git a/panda/src/chan/animBundle.h b/panda/src/chan/animBundle.h index bbdf4a1d67..4225378ff1 100644 --- a/panda/src/chan/animBundle.h +++ b/panda/src/chan/animBundle.h @@ -19,11 +19,12 @@ #ifndef ANIMBUNDLE_H #define ANIMBUNDLE_H -#include +#include "pandabase.h" #include "animGroup.h" +#include "pointerTo.h" -#include +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : AnimBundle diff --git a/panda/src/chan/qpanimBundleNode.I b/panda/src/chan/animBundleNode.I similarity index 73% rename from panda/src/chan/qpanimBundleNode.I rename to panda/src/chan/animBundleNode.I index 207b17330b..82f8fe59cd 100644 --- a/panda/src/chan/qpanimBundleNode.I +++ b/panda/src/chan/animBundleNode.I @@ -1,4 +1,4 @@ -// Filename: qpanimBundleNode.I +// Filename: animBundleNode.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,50 +18,50 @@ //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::Constructor +// Function: AnimBundleNode::Constructor // Access: Public // Description: The AnimBundle and its node should be constructed // together. Generally, the derived classes of -// qpAnimBundleNode will automatically create a AnimBundle +// AnimBundleNode will automatically create a AnimBundle // of the appropriate type, and pass it up to this // constructor. //////////////////////////////////////////////////////////////////// -INLINE qpAnimBundleNode:: -qpAnimBundleNode(const string &name, AnimBundle *bundle) : +INLINE AnimBundleNode:: +AnimBundleNode(const string &name, AnimBundle *bundle) : PandaNode(name), _bundle(bundle) { } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::Default Constructor +// Function: AnimBundleNode::Default Constructor // Access: Protected // Description: For internal use only. //////////////////////////////////////////////////////////////////// -INLINE qpAnimBundleNode:: -qpAnimBundleNode() : PandaNode("") { +INLINE AnimBundleNode:: +AnimBundleNode() : PandaNode("") { } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::Copy Constructor +// Function: AnimBundleNode::Copy Constructor // Access: Protected // Description: Use make_copy() or copy_subgraph() to copy one of -// these. Copying a qpAnimBundleNode will always force a +// these. Copying a AnimBundleNode will always force a // deep copy of the PartGroup hierarchy. //////////////////////////////////////////////////////////////////// -INLINE qpAnimBundleNode:: -qpAnimBundleNode(const qpAnimBundleNode ©) : +INLINE AnimBundleNode:: +AnimBundleNode(const AnimBundleNode ©) : PandaNode(copy), _bundle(copy._bundle) { } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::get_bundle +// Function: AnimBundleNode::get_bundle // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE AnimBundle *qpAnimBundleNode:: +INLINE AnimBundle *AnimBundleNode:: get_bundle() const { return _bundle; } diff --git a/panda/src/chan/qpanimBundleNode.cxx b/panda/src/chan/animBundleNode.cxx similarity index 84% rename from panda/src/chan/qpanimBundleNode.cxx rename to panda/src/chan/animBundleNode.cxx index 3e6b8e3c72..fe5ec7adde 100644 --- a/panda/src/chan/qpanimBundleNode.cxx +++ b/panda/src/chan/animBundleNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpanimBundleNode.cxx +// Filename: animBundleNode.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,17 +16,17 @@ // //////////////////////////////////////////////////////////////////// -#include "qpanimBundleNode.h" +#include "animBundleNode.h" #include "datagram.h" #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" -TypeHandle qpAnimBundleNode::_type_handle; +TypeHandle AnimBundleNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::safe_to_flatten +// Function: AnimBundleNode::safe_to_flatten // Access: Public, Virtual // Description: Returns true if it is generally safe to flatten out // this particular kind of Node by duplicating @@ -34,42 +34,42 @@ TypeHandle qpAnimBundleNode::_type_handle; // cannot be safely flattened, because the Camera // pointer itself is meaningful). //////////////////////////////////////////////////////////////////// -bool qpAnimBundleNode:: +bool AnimBundleNode:: safe_to_flatten() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::register_with_read_factory +// Function: AnimBundleNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpAnimBundleNode. +// AnimBundleNode. //////////////////////////////////////////////////////////////////// -void qpAnimBundleNode:: +void AnimBundleNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::write_datagram +// Function: AnimBundleNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpAnimBundleNode:: +void AnimBundleNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); manager->write_pointer(dg, _bundle); } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::complete_pointers +// Function: AnimBundleNode::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpAnimBundleNode:: +int AnimBundleNode:: complete_pointers(TypedWritable **p_list, BamReader* manager) { int pi = PandaNode::complete_pointers(p_list, manager); _bundle = DCAST(AnimBundle, p_list[pi++]); @@ -77,16 +77,16 @@ complete_pointers(TypedWritable **p_list, BamReader* manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::make_from_bam +// Function: AnimBundleNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory // when a new object of this type is encountered // in the Bam file. It should create the object // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpAnimBundleNode:: +TypedWritable *AnimBundleNode:: make_from_bam(const FactoryParams ¶ms) { - qpAnimBundleNode *node = new qpAnimBundleNode; + AnimBundleNode *node = new AnimBundleNode; DatagramIterator scan; BamReader *manager; @@ -97,13 +97,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpAnimBundleNode::fillin +// Function: AnimBundleNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for // the new PandaNode. //////////////////////////////////////////////////////////////////// -void qpAnimBundleNode:: +void AnimBundleNode:: fillin(DatagramIterator &scan, BamReader* manager) { PandaNode::fillin(scan, manager); manager->read_pointer(scan); diff --git a/panda/src/chan/qpanimBundleNode.h b/panda/src/chan/animBundleNode.h similarity index 82% rename from panda/src/chan/qpanimBundleNode.h rename to panda/src/chan/animBundleNode.h index 96e8011cfe..aba22bad5c 100644 --- a/panda/src/chan/qpanimBundleNode.h +++ b/panda/src/chan/animBundleNode.h @@ -1,4 +1,4 @@ -// Filename: qpanimBundleNode.h +// Filename: animBundleNode.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpANIMBUNDLENODE_H -#define qpANIMBUNDLENODE_H +#ifndef ANIMBUNDLENODE_H +#define ANIMBUNDLENODE_H #include "pandabase.h" @@ -27,18 +27,18 @@ #include "dcast.h" //////////////////////////////////////////////////////////////////// -// Class : qpAnimBundleNode +// Class : AnimBundleNode // Description : This is a node that contains a pointer to an // AnimBundle. Like AnimBundleNode, it exists solely to // make it easy to store AnimBundles in the scene graph. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpAnimBundleNode : public PandaNode { +class EXPCL_PANDA AnimBundleNode : public PandaNode { public: - INLINE qpAnimBundleNode(const string &name, AnimBundle *bundle); + INLINE AnimBundleNode(const string &name, AnimBundle *bundle); protected: - INLINE qpAnimBundleNode(); - INLINE qpAnimBundleNode(const qpAnimBundleNode ©); + INLINE AnimBundleNode(); + INLINE AnimBundleNode(const AnimBundleNode ©); public: virtual bool safe_to_flatten() const; @@ -69,7 +69,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpAnimBundleNode", + register_type(_type_handle, "AnimBundleNode", PandaNode::get_class_type()); } @@ -77,6 +77,6 @@ private: static TypeHandle _type_handle; }; -#include "qpanimBundleNode.I" +#include "animBundleNode.I" #endif diff --git a/panda/src/chan/animChannelMatrixXfmTable.cxx b/panda/src/chan/animChannelMatrixXfmTable.cxx index abfef0b10f..9a37fd9988 100644 --- a/panda/src/chan/animChannelMatrixXfmTable.cxx +++ b/panda/src/chan/animChannelMatrixXfmTable.cxx @@ -319,13 +319,6 @@ fillin(DatagramIterator& scan, BamReader* manager) } else { // Compressed channels. - if (manager->get_file_minor_ver() < 1) { - chan_cat.error() - << "Cannot read old-style quantized channels.\n"; - clear_all_tables(); - return; - } - if (!read_compressed_channels) { chan_cat.info() << "Not reading compressed animation channels.\n"; @@ -334,11 +327,6 @@ fillin(DatagramIterator& scan, BamReader* manager) } FFTCompressor compressor; - if (manager->get_file_minor_ver() < 4) { - // Prior to bam version 3.4, the quaternion code had been - // inadvertently transposed. - compressor.set_transpose_quats(true); - } compressor.read_header(scan); int i; diff --git a/panda/src/chan/animChannelScalarTable.cxx b/panda/src/chan/animChannelScalarTable.cxx index 21b8fb5468..97bbf6651a 100644 --- a/panda/src/chan/animChannelScalarTable.cxx +++ b/panda/src/chan/animChannelScalarTable.cxx @@ -258,12 +258,6 @@ fillin(DatagramIterator& scan, BamReader* manager) } else { // Compressed channels. - if (manager->get_file_minor_ver() < 1) { - chan_cat.error() - << "Cannot read old-style quantized channels.\n"; - return; - } - // Did we write them as discrete or continuous channel values? int index_length = scan.get_uint8(); diff --git a/panda/src/chan/animGroup.h b/panda/src/chan/animGroup.h index 3bdc786f7f..823df926b4 100644 --- a/panda/src/chan/animGroup.h +++ b/panda/src/chan/animGroup.h @@ -19,14 +19,15 @@ #ifndef ANIMGROUP_H #define ANIMGROUP_H -#include +#include "pandabase.h" -#include -#include -#include +#include "typedWritableReferenceCount.h" +#include "pointerTo.h" +#include "namable.h" class AnimBundle; class BamReader; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : AnimGroup diff --git a/panda/src/chan/auto_bind.cxx b/panda/src/chan/auto_bind.cxx index c943b572bb..18c22c37e5 100644 --- a/panda/src/chan/auto_bind.cxx +++ b/panda/src/chan/auto_bind.cxx @@ -18,16 +18,16 @@ #include "auto_bind.h" -#include "qpanimBundleNode.h" -#include "qppartBundleNode.h" +#include "animBundleNode.h" +#include "partBundleNode.h" #include "config_chan.h" #include "string_utils.h" -typedef pset qpAnimNodes; -typedef pmap qpAnims; +typedef pset AnimNodes; +typedef pmap Anims; -typedef pset qpPartNodes; -typedef pmap qpParts; +typedef pset PartNodes; +typedef pmap Parts; //////////////////////////////////////////////////////////////////// @@ -38,16 +38,16 @@ typedef pmap qpParts; // sense. //////////////////////////////////////////////////////////////////// static void -qpbind_anims(const qpPartNodes &parts, const qpAnimNodes &anims, +bind_anims(const PartNodes &parts, const AnimNodes &anims, AnimControlCollection &controls, int hierarchy_match_flags) { - qpPartNodes::const_iterator pni; + PartNodes::const_iterator pni; for (pni = parts.begin(); pni != parts.end(); ++pni) { PartBundle *part = (*pni)->get_bundle(); - qpAnimNodes::const_iterator ani; + AnimNodes::const_iterator ani; for (ani = anims.begin(); ani != anims.end(); ++ani) { AnimBundle *anim = (*ani)->get_bundle(); @@ -96,13 +96,13 @@ qpbind_anims(const qpPartNodes &parts, const qpAnimNodes &anims, // PartBundles and AnimBundles. //////////////////////////////////////////////////////////////////// static void -r_find_bundles(PandaNode *node, qpAnims &anims, qpParts &parts) { - if (node->is_of_type(qpAnimBundleNode::get_class_type())) { - qpAnimBundleNode *bn = DCAST(qpAnimBundleNode, node); +r_find_bundles(PandaNode *node, Anims &anims, Parts &parts) { + if (node->is_of_type(AnimBundleNode::get_class_type())) { + AnimBundleNode *bn = DCAST(AnimBundleNode, node); anims[bn->get_bundle()->get_name()].insert(bn); - } else if (node->is_of_type(qpPartBundleNode::get_class_type())) { - qpPartBundleNode *bn = DCAST(qpPartBundleNode, node); + } else if (node->is_of_type(PartBundleNode::get_class_type())) { + PartBundleNode *bn = DCAST(PartBundleNode, node); parts[bn->get_bundle()->get_name()].insert(bn); } @@ -127,14 +127,14 @@ void auto_bind(PandaNode *root_node, AnimControlCollection &controls, int hierarchy_match_flags) { // First, locate all the bundles in the subgraph. - qpAnims anims; - qpParts parts; + Anims anims; + Parts parts; r_find_bundles(root_node, anims, parts); // Now, match up the bundles by name. - qpAnims::const_iterator ai = anims.begin(); - qpParts::const_iterator pi = parts.begin(); + Anims::const_iterator ai = anims.begin(); + Parts::const_iterator pi = parts.begin(); while (ai != anims.end() && pi != parts.end()) { if ((*ai).first < (*pi).first) { @@ -147,7 +147,7 @@ auto_bind(PandaNode *root_node, AnimControlCollection &controls, } else { // But here we have (at least one) match! - qpbind_anims((*pi).second, (*ai).second, controls, + bind_anims((*pi).second, (*ai).second, controls, hierarchy_match_flags); ++pi; diff --git a/panda/src/chan/chan_composite1.cxx b/panda/src/chan/chan_composite1.cxx index 2b74be96f9..b88ac72832 100644 --- a/panda/src/chan/chan_composite1.cxx +++ b/panda/src/chan/chan_composite1.cxx @@ -5,7 +5,7 @@ #include "movingPartMatrix.cxx" #include "movingPartScalar.cxx" #include "partBundle.cxx" -#include "qppartBundleNode.cxx" +#include "partBundleNode.cxx" #include "partGroup.cxx" #include "vector_PartGroupStar.cxx" diff --git a/panda/src/chan/chan_composite2.cxx b/panda/src/chan/chan_composite2.cxx index a89885463e..c501eca931 100644 --- a/panda/src/chan/chan_composite2.cxx +++ b/panda/src/chan/chan_composite2.cxx @@ -1,6 +1,6 @@ #include "animBundle.cxx" -#include "qpanimBundleNode.cxx" +#include "animBundleNode.cxx" #include "animChannel.cxx" #include "animChannelBase.cxx" #include "animChannelMatrixXfmTable.cxx" diff --git a/panda/src/chan/config_chan.cxx b/panda/src/chan/config_chan.cxx index 43f8c77f3e..34dfc8abea 100644 --- a/panda/src/chan/config_chan.cxx +++ b/panda/src/chan/config_chan.cxx @@ -19,7 +19,7 @@ #include "config_chan.h" #include "animBundle.h" -#include "qpanimBundleNode.h" +#include "animBundleNode.h" #include "animChannelBase.h" #include "animChannelMatrixXfmTable.h" #include "animChannelScalarTable.h" @@ -29,7 +29,7 @@ #include "movingPartMatrix.h" #include "movingPartScalar.h" #include "partBundle.h" -#include "qppartBundleNode.h" +#include "partBundleNode.h" #include "partGroup.h" #include "luse.h" @@ -78,7 +78,7 @@ bool read_compressed_channels = config_chan.GetBool("read-compressed-channels", ConfigureFn(config_chan) { AnimBundle::init_type(); - qpAnimBundleNode::init_type(); + AnimBundleNode::init_type(); AnimChannelBase::init_type(); AnimChannelMatrixXfmTable::init_type(); AnimChannelScalarTable::init_type(); @@ -88,7 +88,7 @@ ConfigureFn(config_chan) { MovingPartMatrix::init_type(); MovingPartScalar::init_type(); PartBundle::init_type(); - qpPartBundleNode::init_type(); + PartBundleNode::init_type(); PartGroup::init_type(); // This isn't defined in this package, but it *is* essential that it @@ -106,7 +106,7 @@ ConfigureFn(config_chan) { AnimGroup::register_with_read_factory(); AnimBundle::register_with_read_factory(); - qpAnimBundleNode::register_with_read_factory(); + AnimBundleNode::register_with_read_factory(); AnimChannelMatrixXfmTable::register_with_read_factory(); AnimChannelScalarTable::register_with_read_factory(); } diff --git a/panda/src/chan/partBundle.I b/panda/src/chan/partBundle.I index f78889eb7d..b63aabb11b 100644 --- a/panda/src/chan/partBundle.I +++ b/panda/src/chan/partBundle.I @@ -39,17 +39,6 @@ get_node() const { return _node; } -//////////////////////////////////////////////////////////////////// -// Function: PartBundle::get_qpnode -// Access: Published -// Description: Returns the PartBundleNode associated with this -// PartBundle. -//////////////////////////////////////////////////////////////////// -INLINE qpPartBundleNode *PartBundle:: -get_qpnode() const { - return _qpnode; -} - //////////////////////////////////////////////////////////////////// // Function: PartBundle::control_begin // Access: Public diff --git a/panda/src/chan/partBundle.cxx b/panda/src/chan/partBundle.cxx index 6390db7e55..9a1241c347 100644 --- a/panda/src/chan/partBundle.cxx +++ b/panda/src/chan/partBundle.cxx @@ -22,11 +22,11 @@ #include "animControl.h" #include "config_chan.h" -#include -#include -#include -#include -#include +#include "indent.h" +#include "datagram.h" +#include "datagramIterator.h" +#include "bamReader.h" +#include "bamWriter.h" TypeHandle PartBundle::_type_handle; diff --git a/panda/src/chan/partBundle.h b/panda/src/chan/partBundle.h index 607078f3cf..bb4795ca6a 100644 --- a/panda/src/chan/partBundle.h +++ b/panda/src/chan/partBundle.h @@ -30,7 +30,7 @@ class AnimBundle; class PartBundleNode; -class qpPartBundleNode; +class PartBundleNode; //////////////////////////////////////////////////////////////////// // Class : PartBundle @@ -94,7 +94,6 @@ PUBLISHED: INLINE BlendType get_blend_type() const; INLINE PartBundleNode *get_node() const; - INLINE qpPartBundleNode *get_qpnode() const; void clear_control_effects(); void set_control_effect(AnimControl *control, float effect); @@ -133,7 +132,6 @@ protected: BlendType _blend_type; PartBundleNode *_node; - qpPartBundleNode *_qpnode; AnimControl *_last_control_set; ChannelBlend _blend; @@ -165,7 +163,6 @@ private: static TypeHandle _type_handle; friend class PartBundleNode; - friend class qpPartBundleNode; }; inline ostream &operator <<(ostream &out, const PartBundle &bundle) { diff --git a/panda/src/chan/qppartBundleNode.I b/panda/src/chan/partBundleNode.I similarity index 72% rename from panda/src/chan/qppartBundleNode.I rename to panda/src/chan/partBundleNode.I index d3ed25305a..f75f699221 100644 --- a/panda/src/chan/qppartBundleNode.I +++ b/panda/src/chan/partBundleNode.I @@ -1,4 +1,4 @@ -// Filename: qppartBundleNode.I +// Filename: partBundleNode.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,52 +18,52 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::Constructor +// Function: PartBundleNode::Constructor // Access: Public // Description: The PartBundle and its node should be constructed // together. Generally, the derived classes of -// qpPartBundleNode will automatically create a PartBundle +// PartBundleNode will automatically create a PartBundle // of the appropriate type, and pass it up to this // constructor. //////////////////////////////////////////////////////////////////// -INLINE qpPartBundleNode:: -qpPartBundleNode(const string &name, PartBundle *bundle) : +INLINE PartBundleNode:: +PartBundleNode(const string &name, PartBundle *bundle) : PandaNode(name), _bundle(bundle) { - _bundle->_qpnode = this; + _bundle->_node = this; } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::Default Constructor +// Function: PartBundleNode::Default Constructor // Access: Protected // Description: For internal use only. //////////////////////////////////////////////////////////////////// -INLINE qpPartBundleNode:: -qpPartBundleNode() : PandaNode("") { +INLINE PartBundleNode:: +PartBundleNode() : PandaNode("") { } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::Copy Constructor +// Function: PartBundleNode::Copy Constructor // Access: Protected // Description: Use make_copy() or copy_subgraph() to copy one of -// these. Copying a qpPartBundleNode will always force a +// these. Copying a PartBundleNode will always force a // deep copy of the PartGroup hierarchy. //////////////////////////////////////////////////////////////////// -INLINE qpPartBundleNode:: -qpPartBundleNode(const qpPartBundleNode ©) : +INLINE PartBundleNode:: +PartBundleNode(const PartBundleNode ©) : PandaNode(copy), _bundle(DCAST(PartBundle, copy._bundle->copy_subgraph())) { - _bundle->_qpnode = this; + _bundle->_node = this; } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::get_bundle +// Function: PartBundleNode::get_bundle // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE PartBundle *qpPartBundleNode:: +INLINE PartBundle *PartBundleNode:: get_bundle() const { return _bundle; } diff --git a/panda/src/chan/qppartBundleNode.cxx b/panda/src/chan/partBundleNode.cxx similarity index 86% rename from panda/src/chan/qppartBundleNode.cxx rename to panda/src/chan/partBundleNode.cxx index b3465c9e8e..a5b1952e71 100644 --- a/panda/src/chan/qppartBundleNode.cxx +++ b/panda/src/chan/partBundleNode.cxx @@ -1,4 +1,4 @@ -// Filename: qppartBundleNode.cxx +// Filename: partBundleNode.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,17 +16,17 @@ // //////////////////////////////////////////////////////////////////// -#include "qppartBundleNode.h" +#include "partBundleNode.h" #include "datagram.h" #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" -TypeHandle qpPartBundleNode::_type_handle; +TypeHandle PartBundleNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::safe_to_flatten +// Function: PartBundleNode::safe_to_flatten // Access: Public, Virtual // Description: Returns true if it is generally safe to flatten out // this particular kind of Node by duplicating @@ -34,46 +34,46 @@ TypeHandle qpPartBundleNode::_type_handle; // cannot be safely flattened, because the Camera // pointer itself is meaningful). //////////////////////////////////////////////////////////////////// -bool qpPartBundleNode:: +bool PartBundleNode:: safe_to_flatten() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::write_datagram +// Function: PartBundleNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpPartBundleNode:: +void PartBundleNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); manager->write_pointer(dg, _bundle); } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::complete_pointers +// Function: PartBundleNode::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpPartBundleNode:: +int PartBundleNode:: complete_pointers(TypedWritable **p_list, BamReader* manager) { int pi = PandaNode::complete_pointers(p_list, manager); _bundle = DCAST(PartBundle, p_list[pi++]); - _bundle->_qpnode = this; + _bundle->_node = this; return pi; } //////////////////////////////////////////////////////////////////// -// Function: qpPartBundleNode::fillin +// Function: PartBundleNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for // the new PandaNode. //////////////////////////////////////////////////////////////////// -void qpPartBundleNode:: +void PartBundleNode:: fillin(DatagramIterator &scan, BamReader* manager) { PandaNode::fillin(scan, manager); manager->read_pointer(scan); diff --git a/panda/src/chan/qppartBundleNode.h b/panda/src/chan/partBundleNode.h similarity index 81% rename from panda/src/chan/qppartBundleNode.h rename to panda/src/chan/partBundleNode.h index 5f4e6daf89..8e54f5d83f 100644 --- a/panda/src/chan/qppartBundleNode.h +++ b/panda/src/chan/partBundleNode.h @@ -1,4 +1,4 @@ -// Filename: qppartBundleNode.h +// Filename: partBundleNode.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPARTBUNDLENODE_H -#define qpPARTBUNDLENODE_H +#ifndef PARTBUNDLENODE_H +#define PARTBUNDLENODE_H #include "pandabase.h" @@ -27,18 +27,18 @@ #include "dcast.h" //////////////////////////////////////////////////////////////////// -// Class : qpPartBundleNode +// Class : PartBundleNode // Description : This is a node that contains a pointer to an // PartBundle. Like AnimBundleNode, it exists solely to // make it easy to store PartBundles in the scene graph. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPartBundleNode : public PandaNode { +class EXPCL_PANDA PartBundleNode : public PandaNode { public: - INLINE qpPartBundleNode(const string &name, PartBundle *bundle); + INLINE PartBundleNode(const string &name, PartBundle *bundle); protected: - INLINE qpPartBundleNode(); - INLINE qpPartBundleNode(const qpPartBundleNode ©); + INLINE PartBundleNode(); + INLINE PartBundleNode(const PartBundleNode ©); public: virtual bool safe_to_flatten() const; @@ -67,7 +67,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpPartBundleNode", + register_type(_type_handle, "PartBundleNode", PandaNode::get_class_type()); } @@ -75,6 +75,6 @@ private: static TypeHandle _type_handle; }; -#include "qppartBundleNode.I" +#include "partBundleNode.I" #endif diff --git a/panda/src/chan/partGroup.h b/panda/src/chan/partGroup.h index 3a3fae91ff..e794f0f91f 100644 --- a/panda/src/chan/partGroup.h +++ b/panda/src/chan/partGroup.h @@ -19,12 +19,12 @@ #ifndef PARTGROUP_H #define PARTGROUP_H -#include +#include "pandabase.h" -#include -#include -#include -#include +#include "typedWritableReferenceCount.h" +#include "pointerTo.h" +#include "namable.h" +#include "typedef.h" #include "plist.h" @@ -32,6 +32,7 @@ class AnimControl; class AnimGroup; class PartBundle; class BamReader; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : PartGroup @@ -130,7 +131,6 @@ private: static TypeHandle _type_handle; friend class Character; - friend class qpCharacter; }; #include "partGroup.I" diff --git a/panda/src/chancfg/chancfg.I b/panda/src/chancfg/chancfg.I index aa60ba26c5..cb698c288a 100644 --- a/panda/src/chancfg/chancfg.I +++ b/panda/src/chancfg/chancfg.I @@ -16,22 +16,22 @@ // //////////////////////////////////////////////////////////////////// - INLINE PandaNode *qpChanConfig::get_group_node(const int node_index) const { + INLINE PandaNode *ChanConfig::get_group_node(const int node_index) const { return _group_node[node_index]; } - INLINE int qpChanConfig::get_group_membership(const int dr_index) const { + INLINE int ChanConfig::get_group_membership(const int dr_index) const { return _group_membership[dr_index]; } - INLINE int qpChanConfig::get_num_groups(void) const { + INLINE int ChanConfig::get_num_groups(void) const { return _group_node.size(); } - INLINE int qpChanConfig::get_num_drs(void) const { + INLINE int ChanConfig::get_num_drs(void) const { return _display_region.size(); } - INLINE PT(DisplayRegion) qpChanConfig::get_dr(const int dr_index) const { + INLINE PT(DisplayRegion) ChanConfig::get_dr(const int dr_index) const { return _display_region[dr_index]; } - INLINE PT(GraphicsWindow) qpChanConfig::get_win(void) const { + INLINE PT(GraphicsWindow) ChanConfig::get_win(void) const { return _graphics_window; } diff --git a/panda/src/chancfg/chancfg.cxx b/panda/src/chancfg/chancfg.cxx index 44214c076b..d7d395c78e 100644 --- a/panda/src/chancfg/chancfg.cxx +++ b/panda/src/chancfg/chancfg.cxx @@ -21,7 +21,7 @@ #include "displayRegion.h" #include "graphicsChannel.h" #include "hardwareChannel.h" -#include "qpcamera.h" +#include "camera.h" #include "frustum.h" #include "perspectiveLens.h" #include "dSearchPath.h" @@ -206,10 +206,10 @@ SetupFOV ChanResolveFOV(SetupFOV& fov, float sizeX, float sizeY) { return ret; } -void qpChanConfig::chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, +void ChanConfig::chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S, ChanViewport& V, int hw_offset, int xsize, int ysize, - const qpNodePath &render, bool want_cameras) { + const NodePath &render, bool want_cameras) { int i = min(L.GetNumRegions(), int(S.size())); int j; SVec::iterator k; @@ -243,8 +243,8 @@ void qpChanConfig::chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, v2.bottom(), v2.top()); if (want_cameras && camera[0] != (PandaNode *)NULL) { // now make a camera for it - PT(qpCamera) cam = new qpCamera(""); - dr->set_qpcamera(qpNodePath(cam)); + PT(Camera) cam = new Camera(""); + dr->set_camera(NodePath(cam)); _display_region.push_back(dr); SetupFOV fov = (*k).getFOV(); // The distinction between ConsoleSize and DisplaySize @@ -322,7 +322,7 @@ void qpChanConfig::chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, return; } -qpChanConfig::qpChanConfig(GraphicsPipe* pipe, std::string cfg, const qpNodePath &render, +ChanConfig::ChanConfig(GraphicsPipe* pipe, std::string cfg, const NodePath &render, ChanCfgOverrides& overrides) { ReadChanConfigData(); // check to make sure we know everything we need to @@ -465,10 +465,10 @@ qpChanConfig::qpChanConfig(GraphicsPipe* pipe, std::string cfg, const qpNodePath float ll, rr, bb, tt; dr->get_dimensions(ll, rr, bb, tt); nout << " (" << ll << " " << rr << " " << bb << " " << tt << ")" << endl - << " camera = " << dr->get_qpcamera() << endl; - qpNodePath cmm = dr->get_qpcamera(); + << " camera = " << dr->get_camera() << endl; + NodePath cmm = dr->get_camera(); if (!cmm.is_empty()) { - qpCamera *cmm_node = DCAST(qpCamera, cmm.node()); + Camera *cmm_node = DCAST(Camera, cmm.node()); nout << " active = " << cmm_node->is_active() << endl; int num_cam_drs = cmm_node->get_num_display_regions(); for (int cd = 0; cd < num_cam_drs; cd++) diff --git a/panda/src/chancfg/chancfg.h b/panda/src/chancfg/chancfg.h index d7e7faa7c0..c85d04bcc1 100644 --- a/panda/src/chancfg/chancfg.h +++ b/panda/src/chancfg/chancfg.h @@ -29,7 +29,7 @@ #include "graphicsPipe.h" #include "graphicsWindow.h" #include "pandaNode.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "pmap.h" @@ -103,7 +103,7 @@ extern ChanCfgOverrides ChanOverrideNone; typedef pvector SVec; -class EXPCL_PANDA qpChanConfig +class EXPCL_PANDA ChanConfig { private: std::vector< PT(PandaNode) > _group_node; @@ -112,9 +112,9 @@ private: PT(GraphicsWindow) _graphics_window; void chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S, ChanViewport& V, int hw_offset, - int xsize, int ysize, const qpNodePath &render, bool want_cameras); + int xsize, int ysize, const NodePath &render, bool want_cameras); PUBLISHED: - qpChanConfig(GraphicsPipe*, std::string, const qpNodePath &render, + ChanConfig(GraphicsPipe*, std::string, const NodePath &render, ChanCfgOverrides& = ChanOverrideNone); INLINE PandaNode *get_group_node(const int node_index) const; INLINE int get_group_membership(const int dr_index) const; diff --git a/panda/src/char/Sources.pp b/panda/src/char/Sources.pp index 236f786b1f..bf05a8117c 100644 --- a/panda/src/char/Sources.pp +++ b/panda/src/char/Sources.pp @@ -10,21 +10,21 @@ #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx #define SOURCES \ - qpcharacter.I qpcharacter.h \ + character.I character.h \ characterJoint.h characterJointBundle.I \ characterJointBundle.h characterSlider.h computedVertices.I \ computedVertices.h computedVerticesMorph.I \ computedVerticesMorph.h config_char.h dynamicVertices.h #define INCLUDED_SOURCES \ - qpcharacter.cxx \ + character.cxx \ characterJoint.cxx characterJointBundle.cxx \ characterSlider.cxx computedVertices.cxx \ computedVerticesMorph.cxx config_char.cxx \ dynamicVertices.cxx #define INSTALL_HEADERS \ - qpcharacter.I qpcharacter.h \ + character.I character.h \ characterJoint.h characterJointBundle.I \ characterJointBundle.h characterSlider.h computedVertices.I \ computedVertices.h computedVerticesMorph.I computedVerticesMorph.h \ diff --git a/panda/src/char/char_composite1.cxx b/panda/src/char/char_composite1.cxx index ee75013673..1fc52363d8 100644 --- a/panda/src/char/char_composite1.cxx +++ b/panda/src/char/char_composite1.cxx @@ -1,6 +1,6 @@ #include "config_char.cxx" -#include "qpcharacter.cxx" +#include "character.cxx" #include "characterJoint.cxx" #include "characterJointBundle.cxx" diff --git a/panda/src/char/qpcharacter.I b/panda/src/char/character.I similarity index 75% rename from panda/src/char/qpcharacter.I rename to panda/src/char/character.I index ae4cc3654e..cc0b95b4dd 100644 --- a/panda/src/char/qpcharacter.I +++ b/panda/src/char/character.I @@ -1,4 +1,4 @@ -// Filename: qpcharacter.I +// Filename: character.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -19,69 +19,69 @@ #include "characterJointBundle.h" //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::get_bundle +// Function: Character::get_bundle // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE CharacterJointBundle *qpCharacter:: +INLINE CharacterJointBundle *Character:: get_bundle() const { - return DCAST(CharacterJointBundle, qpPartBundleNode::get_bundle()); + return DCAST(CharacterJointBundle, PartBundleNode::get_bundle()); } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::get_computed_vertices +// Function: Character::get_computed_vertices // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE ComputedVertices *qpCharacter:: +INLINE ComputedVertices *Character:: get_computed_vertices() const { return _computed_vertices; } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::get_num_parts +// Function: Character::get_num_parts // Access: Public // Description: Returns the total number of moving parts (e.g. joints -// and sliders) associated with the qpCharacter. +// and sliders) associated with the Character. //////////////////////////////////////////////////////////////////// -INLINE int qpCharacter:: +INLINE int Character:: get_num_parts() const { return _parts.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::get_part +// Function: Character::get_part // Access: Public // Description: Returns the nth moving part associated with the -// qpCharacter. +// Character. //////////////////////////////////////////////////////////////////// -INLINE PartGroup *qpCharacter:: +INLINE PartGroup *Character:: get_part(int n) const { nassertr(n >= 0 && n < (int)_parts.size(), NULL); return _parts[n]; } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::write_parts +// Function: Character::write_parts // Access: Public -// Description: Writes a list of the qpCharacter's joints and sliders, +// Description: Writes a list of the Character's joints and sliders, // in their hierchical structure, to the indicated // output stream. //////////////////////////////////////////////////////////////////// -INLINE void qpCharacter:: +INLINE void Character:: write_parts(ostream &out) const { get_bundle()->write(out, 0); } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::write_part_values +// Function: Character::write_part_values // Access: Public -// Description: Writes a list of the qpCharacter's joints and sliders, +// Description: Writes a list of the Character's joints and sliders, // along with each current position, in their hierchical // structure, to the indicated output stream. //////////////////////////////////////////////////////////////////// -INLINE void qpCharacter:: +INLINE void Character:: write_part_values(ostream &out) const { get_bundle()->write_with_value(out, 0); } diff --git a/panda/src/char/qpcharacter.cxx b/panda/src/char/character.cxx similarity index 80% rename from panda/src/char/qpcharacter.cxx rename to panda/src/char/character.cxx index 334678bc56..541debce89 100644 --- a/panda/src/char/qpcharacter.cxx +++ b/panda/src/char/character.cxx @@ -1,4 +1,4 @@ -// Filename: qpcharacter.cxx +// Filename: character.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,12 +16,12 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcharacter.h" +#include "character.h" #include "characterJoint.h" #include "computedVertices.h" #include "config_char.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "datagram.h" #include "datagramIterator.h" #include "bamReader.h" @@ -31,20 +31,20 @@ #include "clockObject.h" #include "pStatTimer.h" -TypeHandle qpCharacter::_type_handle; +TypeHandle Character::_type_handle; #ifndef CPPPARSER -PStatCollector qpCharacter::_anim_pcollector("App:Animation"); +PStatCollector Character::_anim_pcollector("App:Animation"); #endif //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::Copy Constructor +// Function: Character::Copy Constructor // Access: Protected -// Description: Use make_copy() or copy_subgraph() to copy a qpCharacter. +// Description: Use make_copy() or copy_subgraph() to copy a Character. //////////////////////////////////////////////////////////////////// -qpCharacter:: -qpCharacter(const qpCharacter ©) : - qpPartBundleNode(copy.get_name(), new CharacterJointBundle(copy.get_bundle()->get_name())), +Character:: +Character(const Character ©) : + PartBundleNode(copy.get_name(), new CharacterJointBundle(copy.get_bundle()->get_name())), _cv(DynamicVertices::deep_copy(copy._cv)), _computed_vertices(copy._computed_vertices), _parts(copy._parts), @@ -58,57 +58,57 @@ qpCharacter(const qpCharacter ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::Constructor +// Function: Character::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCharacter:: -qpCharacter(const string &name) : - qpPartBundleNode(name, new CharacterJointBundle(name)), +Character:: +Character(const string &name) : + PartBundleNode(name, new CharacterJointBundle(name)), _char_pcollector(_anim_pcollector, name) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::Destructor +// Function: Character::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCharacter:: -~qpCharacter() { +Character:: +~Character() { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::make_copy +// Function: Character::make_copy // Access: Public, Virtual -// Description: The qpCharacter make_copy() function will make a new -// copy of the qpCharacter, with all of its joints copied, +// Description: The Character make_copy() function will make a new +// copy of the Character, with all of its joints copied, // and with a new set of dynamic vertex arrays all ready // to go, but it will not copy any of the original -// qpCharacter's geometry, so the new qpCharacter won't look +// Character's geometry, so the new Character won't look // like much. Use copy_subgraph() to make a full copy -// of the qpCharacter. +// of the Character. //////////////////////////////////////////////////////////////////// -PandaNode *qpCharacter:: +PandaNode *Character:: make_copy() const { - return new qpCharacter(*this); + return new Character(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::safe_to_transform +// Function: Character::safe_to_transform // Access: Public, Virtual // Description: Returns true if it is generally safe to transform // this particular kind of Node by calling the xform() // method, false otherwise. For instance, it's usually -// a bad idea to attempt to xform a qpCharacter. +// a bad idea to attempt to xform a Character. //////////////////////////////////////////////////////////////////// -bool qpCharacter:: +bool Character:: safe_to_transform() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::has_cull_callback +// Function: Character::has_cull_callback // Access: Public, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -116,13 +116,13 @@ safe_to_transform() const { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpCharacter:: +bool Character:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::cull_callback +// Function: Character::cull_callback // Access: Public, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -140,8 +140,8 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpCharacter:: -cull_callback(qpCullTraverser *, CullTraverserData &) { +bool Character:: +cull_callback(CullTraverser *, CullTraverserData &) { // For now, we update the character during the cull traversal; this // prevents us from needlessly updating characters that aren't in // the view frustum. We may need a better way to do this @@ -159,14 +159,14 @@ cull_callback(qpCullTraverser *, CullTraverserData &) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::update +// Function: Character::update // Access: Public -// Description: Recalculates the qpCharacter's joints and vertices for +// Description: Recalculates the Character's joints and vertices for // the current frame. Normally this is performed // automatically during the render and need not be // called explicitly. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: update() { // Statistics PStatTimer timer(_char_pcollector); @@ -184,12 +184,12 @@ update() { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::copy_joints +// Function: Character::copy_joints // Access: Private // Description: Recursively walks the joint/slider hierarchy and // creates a new copy of the hierarchy. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: copy_joints(PartGroup *copy, PartGroup *orig) { if (copy->get_type() != orig->get_type()) { char_cat.warning() @@ -211,7 +211,7 @@ copy_joints(PartGroup *copy, PartGroup *orig) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::r_copy_children +// Function: Character::r_copy_children // Access: Protected, Virtual // Description: This is called by r_copy_subgraph(); the copy has // already been made of this particular node (and this @@ -225,16 +225,16 @@ copy_joints(PartGroup *copy, PartGroup *orig) { // access this map, and probably should not even // override this function. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: r_copy_children(const PandaNode *from, PandaNode::InstanceMap &inst_map) { // We assume there will be no instancing going on below the - // qpCharacter node. If there is, too bad; it will get flattened out. + // Character node. If there is, too bad; it will get flattened out. // We preempt the node's r_copy_children() operation with our own // function that keeps track of the old vs. new nodes and also // updates any Geoms we find with our new dynamic vertices. - const qpCharacter *from_char; + const Character *from_char; DCAST_INTO_V(from_char, from); NodeMap node_map; r_copy_char(this, from_char, from_char, node_map); @@ -243,19 +243,19 @@ r_copy_children(const PandaNode *from, PandaNode::InstanceMap &inst_map) { //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::r_copy_char +// Function: Character::r_copy_char // Access: Private // Description: Recursively walks the scene graph hiernodehy below the -// qpCharacter node, duplicating it while noting the +// Character node, duplicating it while noting the // orig:copy node mappings, and also updates any // GeomNodes found. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: r_copy_char(PandaNode *dest, const PandaNode *source, - const qpCharacter *from, qpCharacter::NodeMap &node_map) { + const Character *from, Character::NodeMap &node_map) { if (source->is_geom_node()) { - const qpGeomNode *source_gnode; - qpGeomNode *dest_gnode; + const GeomNode *source_gnode; + GeomNode *dest_gnode; DCAST_INTO_V(source_gnode, source); DCAST_INTO_V(dest_gnode, dest); @@ -274,17 +274,17 @@ r_copy_char(PandaNode *dest, const PandaNode *source, int source_sort = source->get_child_sort(i); PandaNode *dest_child; - if (source_child->is_of_type(qpCharacter::get_class_type())) { - // We make a special case for nodes of type qpCharacter. If we - // encounter one of these, we have a qpCharacter under a - // qpCharacter, and the nested qpCharacter's copy should be called + if (source_child->is_of_type(Character::get_class_type())) { + // We make a special case for nodes of type Character. If we + // encounter one of these, we have a Character under a + // Character, and the nested Character's copy should be called // instead of ours. dest_child = source_child->copy_subgraph(); } else { // Otherwise, we assume that make_copy() will make a suitable // copy of the node. This does limit the sorts of things we can - // have parented to a qpCharacter and expect copy_subgraph() to + // have parented to a Character and expect copy_subgraph() to // work correctly. Too bad. dest_child = source_child->make_copy(); r_copy_char(dest_child, source_child, from, node_map); @@ -295,15 +295,15 @@ r_copy_char(PandaNode *dest, const PandaNode *source, } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::copy_geom +// Function: Character::copy_geom // Access: Private // Description: Makes a new copy of the Geom with the dynamic vertex -// arrays replaced to reference this qpCharacter instead +// arrays replaced to reference this Character instead // of the other one. If no arrays have changed, simply // returns the same Geom. //////////////////////////////////////////////////////////////////// -PT(Geom) qpCharacter:: -copy_geom(Geom *source, const qpCharacter *from) { +PT(Geom) Character:: +copy_geom(Geom *source, const Character *from) { GeomBindType bind; PTA_ushort index; @@ -350,14 +350,14 @@ copy_geom(Geom *source, const qpCharacter *from) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::copy_node_pointers +// Function: Character::copy_node_pointers // Access: Public // Description: Creates _net_transform_nodes and _local_transform_nodes -// as appropriate in each of the qpCharacter's joints, as -// copied from the other qpCharacter. +// as appropriate in each of the Character's joints, as +// copied from the other Character. //////////////////////////////////////////////////////////////////// -void qpCharacter:: -copy_node_pointers(const qpCharacter *from, const qpCharacter::NodeMap &node_map) { +void Character:: +copy_node_pointers(const Character *from, const Character::NodeMap &node_map) { nassertv(_parts.size() == from->_parts.size()); for (int i = 0; i < (int)_parts.size(); i++) { if (_parts[i]->is_of_type(CharacterJoint::get_class_type())) { @@ -378,7 +378,7 @@ copy_node_pointers(const qpCharacter *from, const qpCharacter::NodeMap &node_map if (mi != node_map.end()) { PandaNode *dest_node = (*mi).second; - // Here's an internal joint that the source qpCharacter was + // Here's an internal joint that the source Character was // animating directly. We'll animate our corresponding // joint the same way. dest_joint->add_net_transform(dest_node); @@ -395,7 +395,7 @@ copy_node_pointers(const qpCharacter *from, const qpCharacter::NodeMap &node_map if (mi != node_map.end()) { PandaNode *dest_node = (*mi).second; - // Here's an internal joint that the source qpCharacter was + // Here's an internal joint that the source Character was // animating directly. We'll animate our corresponding // joint the same way. dest_joint->add_local_transform(dest_node); @@ -407,25 +407,25 @@ copy_node_pointers(const qpCharacter *from, const qpCharacter::NodeMap &node_map //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::register_with_read_factory +// Function: Character::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpCharacter. +// Character. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::write_datagram +// Function: Character::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: write_datagram(BamWriter *manager, Datagram &dg) { - qpPartBundleNode::write_datagram(manager, dg); + PartBundleNode::write_datagram(manager, dg); _cv.write_datagram(manager, dg); manager->write_pointer(dg, _computed_vertices); @@ -437,15 +437,15 @@ write_datagram(BamWriter *manager, Datagram &dg) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::complete_pointers +// Function: Character::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpCharacter:: +int Character:: complete_pointers(TypedWritable **p_list, BamReader *manager) { - int pi = qpPartBundleNode::complete_pointers(p_list, manager); + int pi = PartBundleNode::complete_pointers(p_list, manager); _computed_vertices = DCAST(ComputedVertices, p_list[pi++]); int num_parts = _parts.size(); @@ -457,16 +457,16 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::make_from_bam +// Function: Character::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpCharacter is encountered -// in the Bam file. It should create the qpCharacter +// when a new object of type Character is encountered +// in the Bam file. It should create the Character // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpCharacter:: +TypedWritable *Character:: make_from_bam(const FactoryParams ¶ms) { - qpCharacter *node = new qpCharacter(""); + Character *node = new Character(""); DatagramIterator scan; BamReader *manager; @@ -477,15 +477,15 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacter::fillin +// Function: Character::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpCharacter. +// the new Character. //////////////////////////////////////////////////////////////////// -void qpCharacter:: +void Character:: fillin(DatagramIterator &scan, BamReader *manager) { - qpPartBundleNode::fillin(scan, manager); + PartBundleNode::fillin(scan, manager); _cv.fillin(scan, manager); manager->read_pointer(scan); diff --git a/panda/src/char/qpcharacter.h b/panda/src/char/character.h similarity index 78% rename from panda/src/char/qpcharacter.h rename to panda/src/char/character.h index 520369ff66..090bfe738d 100644 --- a/panda/src/char/qpcharacter.h +++ b/panda/src/char/character.h @@ -1,4 +1,4 @@ -// Filename: qpcharacter.h +// Filename: character.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,14 +16,14 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCHARACTER_H -#define qpCHARACTER_H +#ifndef CHARACTER_H +#define CHARACTER_H #include "pandabase.h" #include "computedVertices.h" -#include "qppartBundleNode.h" +#include "partBundleNode.h" #include "vector_PartGroupStar.h" #include "pointerTo.h" #include "geom.h" @@ -33,23 +33,23 @@ class CharacterJointBundle; class ComputedVertices; //////////////////////////////////////////////////////////////////// -// Class : qpCharacter +// Class : Character // Description : An animated character, with skeleton-morph animation // and either soft-skinned or hard-skinned vertices. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCharacter : public qpPartBundleNode { +class EXPCL_PANDA Character : public PartBundleNode { protected: - qpCharacter(const qpCharacter ©); + Character(const Character ©); public: - qpCharacter(const string &name); - virtual ~qpCharacter(); + Character(const string &name); + virtual ~Character(); virtual PandaNode *make_copy() const; virtual bool safe_to_transform() const; virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); PUBLISHED: INLINE CharacterJointBundle *get_bundle() const; @@ -70,11 +70,11 @@ private: virtual void r_copy_children(const PandaNode *from, InstanceMap &inst_map); void r_copy_char(PandaNode *dest, const PandaNode *source, - const qpCharacter *from, NodeMap &node_map); - PT(Geom) copy_geom(Geom *source, const qpCharacter *from); - void copy_node_pointers(const qpCharacter *from, const NodeMap &node_map); + const Character *from, NodeMap &node_map); + PT(Geom) copy_geom(Geom *source, const Character *from); + void copy_node_pointers(const Character *from, const NodeMap &node_map); - // These are the actual dynamic vertex pools for this qpCharacter's + // These are the actual dynamic vertex pools for this Character's // ComputedVertices--the vertices that it will recompute each frame // based on the soft-skinning and morphing requirements. Note that // we store this concretely, instead of as a pointer, just because @@ -82,7 +82,7 @@ private: DynamicVertices _cv; // And this is the object that animates them. It *is* a pointer, so - // it can be shared between multiple instances of this qpCharacter. + // it can be shared between multiple instances of this Character. PT(ComputedVertices) _computed_vertices; // This vector is used by the ComputedVertices object to index back @@ -113,20 +113,20 @@ public: return _type_handle; } static void init_type() { - qpPartBundleNode::init_type(); - register_type(_type_handle, "qpCharacter", - qpPartBundleNode::get_class_type()); + PartBundleNode::init_type(); + register_type(_type_handle, "Character", + PartBundleNode::get_class_type()); } private: static TypeHandle _type_handle; - friend class qpCharacterMaker; + friend class CharacterMaker; friend class ComputedVerticesMaker; friend class ComputedVertices; }; -#include "qpcharacter.I" +#include "character.I" #endif diff --git a/panda/src/char/characterJoint.cxx b/panda/src/char/characterJoint.cxx index b9e86cc8d1..2a9e9e988f 100644 --- a/panda/src/char/characterJoint.cxx +++ b/panda/src/char/characterJoint.cxx @@ -263,11 +263,6 @@ write_datagram(BamWriter *manager, Datagram &me) NodeList::iterator ni; MovingPartMatrix::write_datagram(manager, me); - // Legacy. We don't store the list of arcs any more. Remove this - // when we go to bam version 4.0. - me.add_uint16(0); - me.add_uint16(0); - me.add_uint16(_net_transform_nodes.size()); for(ni = _net_transform_nodes.begin(); ni != _net_transform_nodes.end(); @@ -298,26 +293,14 @@ fillin(DatagramIterator &scan, BamReader *manager) { int i; MovingPartMatrix::fillin(scan, manager); - // Remove this when we go to bam 4.0. - int num_net_arcs = scan.get_uint16(); - nassertv(num_net_arcs == 0); - int num_local_arcs = scan.get_uint16(); - nassertv(num_local_arcs == 0); - - if (manager->get_file_minor_ver() < 7) { - // No _node lists before version 3.7. - _num_net_nodes = 0; - _num_local_nodes = 0; - } else { - _num_net_nodes = scan.get_uint16(); - for(i = 0; i < _num_net_nodes; i++) { - manager->read_pointer(scan); - } - - _num_local_nodes = scan.get_uint16(); - for(i = 0; i < _num_local_nodes; i++) { - manager->read_pointer(scan); - } + _num_net_nodes = scan.get_uint16(); + for(i = 0; i < _num_net_nodes; i++) { + manager->read_pointer(scan); + } + + _num_local_nodes = scan.get_uint16(); + for(i = 0; i < _num_local_nodes; i++) { + manager->read_pointer(scan); } _initial_net_transform_inverse.read_datagram(scan); diff --git a/panda/src/char/characterJoint.h b/panda/src/char/characterJoint.h index db67235062..f1f9f038dc 100644 --- a/panda/src/char/characterJoint.h +++ b/panda/src/char/characterJoint.h @@ -78,7 +78,7 @@ public: // for the CharacterMaker's convenenience while creating the // character. It does not store any meaningful value after // creation is complete. - PT(PandaNode) _qpgeom_node; + PT(PandaNode) _geom_node; // These are filled in as the joint animates. LMatrix4f _net_transform; @@ -102,7 +102,6 @@ private: static TypeHandle _type_handle; friend class Character; - friend class qpCharacter; }; #endif diff --git a/panda/src/char/characterJointBundle.I b/panda/src/char/characterJointBundle.I index c120c36096..5284f7196c 100644 --- a/panda/src/char/characterJointBundle.I +++ b/panda/src/char/characterJointBundle.I @@ -20,7 +20,7 @@ // #include reference, and please don't bother us about it. The line // must be exactly as shown. /* okcircular */ -#include "qpcharacter.h" +#include "character.h" //////////////////////////////////////////////////////////////////// // Function: CharacterJointBundle::Copy Constructor @@ -35,12 +35,12 @@ CharacterJointBundle(const CharacterJointBundle ©) : } //////////////////////////////////////////////////////////////////// -// Function: CharacterJointBundle::get_qpnode +// Function: CharacterJointBundle::get_node // Access: Public // Description: Returns the Character node associated with this // PartBundle. //////////////////////////////////////////////////////////////////// -INLINE qpCharacter *CharacterJointBundle:: -get_qpnode() const { - return DCAST(qpCharacter, PartBundle::get_qpnode()); +INLINE Character *CharacterJointBundle:: +get_node() const { + return DCAST(Character, PartBundle::get_node()); } diff --git a/panda/src/char/characterJointBundle.h b/panda/src/char/characterJointBundle.h index 680d23d1be..900ecf651c 100644 --- a/panda/src/char/characterJointBundle.h +++ b/panda/src/char/characterJointBundle.h @@ -25,7 +25,7 @@ #include "partGroup.h" #include "animControl.h" -class qpCharacter; +class Character; //////////////////////////////////////////////////////////////////// // Class : CharacterJointBundle @@ -40,7 +40,7 @@ public: CharacterJointBundle(const string &name = ""); PUBLISHED: - INLINE qpCharacter *get_qpnode() const; + INLINE Character *get_node() const; public: virtual PartGroup *make_copy() const; diff --git a/panda/src/char/computedVertices.cxx b/panda/src/char/computedVertices.cxx index 6d988848a2..a559d04f55 100644 --- a/panda/src/char/computedVertices.cxx +++ b/panda/src/char/computedVertices.cxx @@ -19,7 +19,7 @@ #include "computedVertices.h" #include "characterJoint.h" -#include "qpcharacter.h" +#include "character.h" #include "config_char.h" #include "datagram.h" @@ -57,7 +57,7 @@ VertexTransform(const VertexTransform ©) : template static void compute_morphs(ValueType *table, const pvector &morph_list, - qpCharacter *character) { + Character *character) { pvector::const_iterator mli; for (mli = morph_list.begin(); mli != morph_list.end(); ++mli) { const MorphType &morph = (*mli); @@ -136,8 +136,8 @@ read_datagram(DatagramIterator &source) // etc., and the current positions of all of the joints. //////////////////////////////////////////////////////////////////// void ComputedVertices:: -update(qpCharacter *character) { - nassertv(character != (qpCharacter *)NULL); +update(Character *character) { + nassertv(character != (Character *)NULL); nassertv(character->_cv._coords.size() == _orig_coords.size()); nassertv(character->_cv._norms.size() == _orig_norms.size()); nassertv(character->_cv._texcoords.size() == _orig_texcoords.size()); @@ -238,8 +238,8 @@ update(qpCharacter *character) { // etc. arrays. //////////////////////////////////////////////////////////////////// void ComputedVertices:: -make_orig(qpCharacter *character) { - nassertv(character != (qpCharacter *)NULL); +make_orig(Character *character) { + nassertv(character != (Character *)NULL); if (character->_cv._coords.empty()) { _orig_coords.clear(); @@ -276,7 +276,7 @@ make_orig(qpCharacter *character) { // Description: //////////////////////////////////////////////////////////////////// void ComputedVertices:: -write(ostream &out, qpCharacter *character) const { +write(ostream &out, Character *character) const { VertexTransforms::const_iterator vti; out << "ComputedVertices:\n"; diff --git a/panda/src/char/computedVertices.h b/panda/src/char/computedVertices.h index 7fd3936fc1..e770021912 100644 --- a/panda/src/char/computedVertices.h +++ b/panda/src/char/computedVertices.h @@ -27,7 +27,7 @@ #include "vector_ushort.h" #include "typedWritableReferenceCount.h" -class qpCharacter; +class Character; class CharacterJoint; //////////////////////////////////////////////////////////////////// @@ -41,10 +41,10 @@ class EXPCL_PANDA ComputedVertices : public TypedWritableReferenceCount { public: INLINE ComputedVertices(); - void update(qpCharacter *character); - void make_orig(qpCharacter *character); + void update(Character *character); + void make_orig(Character *character); - void write(ostream &out, qpCharacter *character) const; + void write(ostream &out, Character *character) const; private: typedef vector_ushort Vertices; diff --git a/panda/src/char/config_char.cxx b/panda/src/char/config_char.cxx index 549e29ba36..6d6af7d0f9 100644 --- a/panda/src/char/config_char.cxx +++ b/panda/src/char/config_char.cxx @@ -18,7 +18,7 @@ #include "config_char.h" -#include "qpcharacter.h" +#include "character.h" #include "characterJoint.h" #include "characterJointBundle.h" #include "characterSlider.h" @@ -66,7 +66,7 @@ init_libchar() { } initialized = true; - qpCharacter::init_type(); + Character::init_type(); CharacterJoint::init_type(); CharacterJointBundle::init_type(); CharacterSlider::init_type(); @@ -81,7 +81,7 @@ init_libchar() { //Registration of writeable object's creation //functions with BamReader's factory - qpCharacter::register_with_read_factory(); + Character::register_with_read_factory(); CharacterJoint::register_with_read_factory(); CharacterJointBundle::register_with_read_factory(); CharacterSlider::register_with_read_factory(); diff --git a/panda/src/collide/Sources.pp b/panda/src/collide/Sources.pp index 2ceb136237..ced5806daf 100644 --- a/panda/src/collide/Sources.pp +++ b/panda/src/collide/Sources.pp @@ -10,55 +10,55 @@ #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx #define SOURCES \ - qpcollisionEntry.I qpcollisionEntry.h \ - qpcollisionHandler.h \ - qpcollisionHandlerEvent.I qpcollisionHandlerEvent.h \ - qpcollisionHandlerFloor.I qpcollisionHandlerFloor.h \ - qpcollisionHandlerPhysical.I qpcollisionHandlerPhysical.h \ - qpcollisionHandlerPusher.I qpcollisionHandlerPusher.h \ - qpcollisionHandlerQueue.h \ - qpcollisionLevelState.I qpcollisionLevelState.h \ - qpcollisionNode.I qpcollisionNode.h \ + collisionEntry.I collisionEntry.h \ + collisionHandler.h \ + collisionHandlerEvent.I collisionHandlerEvent.h \ + collisionHandlerFloor.I collisionHandlerFloor.h \ + collisionHandlerPhysical.I collisionHandlerPhysical.h \ + collisionHandlerPusher.I collisionHandlerPusher.h \ + collisionHandlerQueue.h \ + collisionLevelState.I collisionLevelState.h \ + collisionNode.I collisionNode.h \ collisionPlane.I collisionPlane.h \ collisionPolygon.I collisionPolygon.h collisionRay.I \ collisionRay.h collisionSegment.I collisionSegment.h \ collisionSolid.I collisionSolid.h collisionSphere.I \ collisionSphere.h \ - qpcollisionTraverser.I qpcollisionTraverser.h \ + collisionTraverser.I collisionTraverser.h \ config_collide.h #define INCLUDED_SOURCES \ - qpcollisionEntry.cxx \ - qpcollisionHandler.cxx \ - qpcollisionHandlerEvent.cxx \ - qpcollisionHandlerFloor.cxx \ - qpcollisionHandlerPhysical.cxx \ - qpcollisionHandlerPusher.cxx \ - qpcollisionHandlerQueue.cxx \ - qpcollisionLevelState.cxx \ - qpcollisionNode.cxx \ + collisionEntry.cxx \ + collisionHandler.cxx \ + collisionHandlerEvent.cxx \ + collisionHandlerFloor.cxx \ + collisionHandlerPhysical.cxx \ + collisionHandlerPusher.cxx \ + collisionHandlerQueue.cxx \ + collisionLevelState.cxx \ + collisionNode.cxx \ collisionPlane.cxx \ collisionPolygon.cxx collisionRay.cxx collisionSegment.cxx \ collisionSolid.cxx collisionSphere.cxx \ - qpcollisionTraverser.cxx \ + collisionTraverser.cxx \ config_collide.cxx #define INSTALL_HEADERS \ - qpcollisionEntry.I qpcollisionEntry.h \ - qpcollisionHandler.h \ - qpcollisionHandlerEvent.I qpcollisionHandlerEvent.h \ - qpcollisionHandlerFloor.I qpcollisionHandlerFloor.h \ - qpcollisionHandlerPhysical.I qpcollisionHandlerPhysical.h \ - qpcollisionHandlerPusher.I qpcollisionHandlerPusher.h \ - qpcollisionHandlerQueue.h \ - qpcollisionLevelState.I qpcollisionLevelState.h \ - qpcollisionNode.I qpcollisionNode.h \ + collisionEntry.I collisionEntry.h \ + collisionHandler.h \ + collisionHandlerEvent.I collisionHandlerEvent.h \ + collisionHandlerFloor.I collisionHandlerFloor.h \ + collisionHandlerPhysical.I collisionHandlerPhysical.h \ + collisionHandlerPusher.I collisionHandlerPusher.h \ + collisionHandlerQueue.h \ + collisionLevelState.I collisionLevelState.h \ + collisionNode.I collisionNode.h \ collisionPlane.I collisionPlane.h \ collisionPolygon.I collisionPolygon.h collisionRay.I collisionRay.h \ collisionSegment.I collisionSegment.h \ collisionSolid.I collisionSolid.h collisionSphere.I \ collisionSphere.h \ - qpcollisionTraverser.I qpcollisionTraverser.h + collisionTraverser.I collisionTraverser.h #define IGATESCAN all diff --git a/panda/src/collide/collide_composite1.cxx b/panda/src/collide/collide_composite1.cxx index bfa1229b00..db2b17beb4 100644 --- a/panda/src/collide/collide_composite1.cxx +++ b/panda/src/collide/collide_composite1.cxx @@ -1,12 +1,12 @@ #include "config_collide.cxx" -#include "qpcollisionEntry.cxx" -#include "qpcollisionHandler.cxx" -#include "qpcollisionHandlerEvent.cxx" -#include "qpcollisionHandlerFloor.cxx" -#include "qpcollisionHandlerPhysical.cxx" -#include "qpcollisionHandlerPusher.cxx" -#include "qpcollisionHandlerQueue.cxx" -#include "qpcollisionLevelState.cxx" -#include "qpcollisionNode.cxx" +#include "collisionEntry.cxx" +#include "collisionHandler.cxx" +#include "collisionHandlerEvent.cxx" +#include "collisionHandlerFloor.cxx" +#include "collisionHandlerPhysical.cxx" +#include "collisionHandlerPusher.cxx" +#include "collisionHandlerQueue.cxx" +#include "collisionLevelState.cxx" +#include "collisionNode.cxx" diff --git a/panda/src/collide/collide_composite2.cxx b/panda/src/collide/collide_composite2.cxx index 66df431553..3d5b0b2779 100644 --- a/panda/src/collide/collide_composite2.cxx +++ b/panda/src/collide/collide_composite2.cxx @@ -5,6 +5,6 @@ #include "collisionSegment.cxx" #include "collisionSolid.cxx" #include "collisionSphere.cxx" -#include "qpcollisionTraverser.cxx" +#include "collisionTraverser.cxx" diff --git a/panda/src/collide/qpcollisionEntry.I b/panda/src/collide/collisionEntry.I similarity index 79% rename from panda/src/collide/qpcollisionEntry.I rename to panda/src/collide/collisionEntry.I index 32b182892f..9ab3026cb4 100644 --- a/panda/src/collide/qpcollisionEntry.I +++ b/panda/src/collide/collisionEntry.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionEntry.I +// Filename: collisionEntry.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,28 +18,28 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::Constructor +// Function: CollisionEntry::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpCollisionEntry:: -qpCollisionEntry() { +INLINE CollisionEntry:: +CollisionEntry() { _flags = 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_from +// Function: CollisionEntry::get_from // Access: Public // Description: Returns the CollisionSolid pointer for the particular // solid that triggered this collision. //////////////////////////////////////////////////////////////////// -INLINE const CollisionSolid *qpCollisionEntry:: +INLINE const CollisionSolid *CollisionEntry:: get_from() const { return _from; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::has_into +// Function: CollisionEntry::has_into // Access: Public // Description: Returns true if the "into" solid is, in fact, a // CollisionSolid, and its pointer is known (in which @@ -48,13 +48,13 @@ get_from() const { // GeomNode, and there is no CollisionSolid pointer to // be retrieved. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionEntry:: +INLINE bool CollisionEntry:: has_into() const { return (_into != (CollisionSolid *)NULL); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into +// Function: CollisionEntry::get_into // Access: Public // Description: Returns the CollisionSolid pointer for the particular // solid was collided into. This pointer might be NULL @@ -62,145 +62,145 @@ has_into() const { // geometry, instead of a normal CollisionSolid // collision; see has_into(). //////////////////////////////////////////////////////////////////// -INLINE const CollisionSolid *qpCollisionEntry:: +INLINE const CollisionSolid *CollisionEntry:: get_into() const { return _into; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_from_node +// Function: CollisionEntry::get_from_node // Access: Public // Description: Returns the node that contains the CollisionSolid // that triggered this collision. This will be a node // that has been added to a CollisionTraverser via // add_collider(). //////////////////////////////////////////////////////////////////// -INLINE qpCollisionNode *qpCollisionEntry:: +INLINE CollisionNode *CollisionEntry:: get_from_node() const { return _from_node; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_from_space +// Function: CollisionEntry::get_from_space // Access: Public // Description: Returns the global coordinate space of the -// qpCollisionNode returned by get_from_node(), as of the +// CollisionNode returned by get_from_node(), as of the // time of the collision. This will be equivalent to a // wrt() from the node to render. //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionEntry:: +INLINE const LMatrix4f &CollisionEntry:: get_from_space() const { return _from_space; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_node +// Function: CollisionEntry::get_into_node // Access: Public // Description: Returns the node that contains the CollisionSolid // that was collided into. This returns a PandaNode // pointer instead of something more specific, because -// it might be either a qpCollisionNode or a GeomNode. +// it might be either a CollisionNode or a GeomNode. // // Also see get_into_node_path(). //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpCollisionEntry:: +INLINE PandaNode *CollisionEntry:: get_into_node() const { return _into_node; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_node_path +// Function: CollisionEntry::get_into_node_path // Access: Public -// Description: Returns the qpNodePath that represents the specific -// qpCollisionNode or GeomNode instance that was collided +// Description: Returns the NodePath that represents the specific +// CollisionNode or GeomNode instance that was collided // into. This is the same node returned by -// get_into_node(), represented as a qpNodePath; however, -// it may be more useful because the qpNodePath can +// get_into_node(), represented as a NodePath; however, +// it may be more useful because the NodePath can // resolve the particular instance of the node, if there // is more than one. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &qpCollisionEntry:: +INLINE const NodePath &CollisionEntry:: get_into_node_path() const { return _into_node_path; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_space +// Function: CollisionEntry::get_into_space // Access: Public // Description: Returns the global coordinate space of the -// qpCollisionNode or GeomNode returned by +// CollisionNode or GeomNode returned by // get_into_node(), as of the time of the collision. //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionEntry:: +INLINE const LMatrix4f &CollisionEntry:: get_into_space() const { return _into_space; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_wrt_space +// Function: CollisionEntry::get_wrt_space // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionEntry:: +INLINE const LMatrix4f &CollisionEntry:: get_wrt_space() const { return _wrt_space; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_inv_wrt_space +// Function: CollisionEntry::get_inv_wrt_space // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionEntry:: +INLINE const LMatrix4f &CollisionEntry:: get_inv_wrt_space() const { return _inv_wrt_space; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::set_into_intersection_point +// Function: CollisionEntry::set_into_intersection_point // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionEntry:: +INLINE void CollisionEntry:: set_into_intersection_point(const LPoint3f &point) { _into_intersection_point = point; _flags |= F_has_into_intersection_point; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::has_into_intersection_point +// Function: CollisionEntry::has_into_intersection_point // Access: Public // Description: Returns true if the detected collision knows its // intersection point in the coordinate space of the // collided-into object, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionEntry:: +INLINE bool CollisionEntry:: has_into_intersection_point() const { return (_flags & F_has_into_intersection_point) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_intersection_point +// Function: CollisionEntry::get_into_intersection_point // Access: Public // Description: Returns the intersection point in the coordinate // space of the collided-into object. It is an error to // call this if has_into_intersection_point() returns // false. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpCollisionEntry:: +INLINE const LPoint3f &CollisionEntry:: get_into_intersection_point() const { nassertr(has_into_intersection_point(), _into_intersection_point); return _into_intersection_point; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::has_from_intersection_point +// Function: CollisionEntry::has_from_intersection_point // Access: Public // Description: Returns true if the detected collision knows its // intersection point in the coordinate space of the // colliding object, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionEntry:: +INLINE bool CollisionEntry:: has_from_intersection_point() const { // Since we derive the from_intersection_point from the // into_intersection_point, this is really the same question. @@ -208,50 +208,50 @@ has_from_intersection_point() const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_from_intersection_point +// Function: CollisionEntry::get_from_intersection_point // Access: Public // Description: Returns the intersection point in the coordinate // space of the colliding object. It is an error to // call this if has_from_intersection_point() returns // false. //////////////////////////////////////////////////////////////////// -INLINE LPoint3f qpCollisionEntry:: +INLINE LPoint3f CollisionEntry:: get_from_intersection_point() const { return get_into_intersection_point() * get_inv_wrt_space(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::set_into_surface_normal +// Function: CollisionEntry::set_into_surface_normal // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionEntry:: +INLINE void CollisionEntry:: set_into_surface_normal(const LVector3f &normal) { _into_surface_normal = normal; _flags |= F_has_into_surface_normal; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::has_into_surface_normal +// Function: CollisionEntry::has_into_surface_normal // Access: Public // Description: Returns true if the detected collision knows the // surface normal of the collided-into object at the // point of the collision, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionEntry:: +INLINE bool CollisionEntry:: has_into_surface_normal() const { return (_flags & F_has_into_surface_normal) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_surface_normal +// Function: CollisionEntry::get_into_surface_normal // Access: Public // Description: Returns the surface normal of the collided-into // object at the point of the collision. It is an error // to call this if has_into_surface_normal() returns // false. //////////////////////////////////////////////////////////////////// -INLINE const LVector3f &qpCollisionEntry:: +INLINE const LVector3f &CollisionEntry:: get_into_surface_normal() const { nassertr(has_into_surface_normal(), _into_surface_normal); return _into_surface_normal; @@ -259,31 +259,31 @@ get_into_surface_normal() const { //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::set_into_depth +// Function: CollisionEntry::set_into_depth // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionEntry:: +INLINE void CollisionEntry:: set_into_depth(float depth) { _into_depth = depth; _flags |= F_has_into_depth; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::has_into_depth +// Function: CollisionEntry::has_into_depth // Access: Public // Description: Returns true if the collision entry knows how "deep" // the collision was into the collided-into object; that // is, how far into the surface of the collided-into // object the colliding object has penetrated. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionEntry:: +INLINE bool CollisionEntry:: has_into_depth() const { return (_flags & F_has_into_depth) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::get_into_depth +// Function: CollisionEntry::get_into_depth // Access: Public // Description: Returns how "deep" the collision was into the // collided-into object; that is, how far into the @@ -291,7 +291,7 @@ has_into_depth() const { // object has penetrated. It is an error to call this // if has_into_depth() returns false. //////////////////////////////////////////////////////////////////// -INLINE float qpCollisionEntry:: +INLINE float CollisionEntry:: get_into_depth() const { nassertr(has_into_depth(), 0.0); return _into_depth; diff --git a/panda/src/collide/qpcollisionEntry.cxx b/panda/src/collide/collisionEntry.cxx similarity index 84% rename from panda/src/collide/qpcollisionEntry.cxx rename to panda/src/collide/collisionEntry.cxx index 26597ad2f3..2ba8d393ec 100644 --- a/panda/src/collide/qpcollisionEntry.cxx +++ b/panda/src/collide/collisionEntry.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionEntry.cxx +// Filename: collisionEntry.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,17 +16,17 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionEntry.h" +#include "collisionEntry.h" -TypeHandle qpCollisionEntry::_type_handle; +TypeHandle CollisionEntry::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::Copy Constructor +// Function: CollisionEntry::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionEntry:: -qpCollisionEntry(const qpCollisionEntry ©) : +CollisionEntry:: +CollisionEntry(const CollisionEntry ©) : _from(copy._from), _into(copy._into), _from_node(copy._from_node), @@ -44,12 +44,12 @@ qpCollisionEntry(const qpCollisionEntry ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionEntry::Copy Assignment Operator +// Function: CollisionEntry::Copy Assignment Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionEntry:: -operator = (const qpCollisionEntry ©) { +void CollisionEntry:: +operator = (const CollisionEntry ©) { _from = copy._from; _into = copy._into; _from_node = copy._from_node; diff --git a/panda/src/collide/qpcollisionEntry.h b/panda/src/collide/collisionEntry.h similarity index 81% rename from panda/src/collide/qpcollisionEntry.h rename to panda/src/collide/collisionEntry.h index adf465e1ac..8e45cc7fa1 100644 --- a/panda/src/collide/qpcollisionEntry.h +++ b/panda/src/collide/collisionEntry.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionEntry.h +// Filename: collisionEntry.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,47 +16,47 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONENTRY_H -#define qpCOLLISIONENTRY_H +#ifndef COLLISIONENTRY_H +#define COLLISIONENTRY_H #include "pandabase.h" #include "collisionSolid.h" -#include "qpcollisionNode.h" +#include "collisionNode.h" #include "typedReferenceCount.h" #include "luse.h" #include "pointerTo.h" #include "pandaNode.h" -#include "qpnodePath.h" +#include "nodePath.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionEntry +// Class : CollisionEntry // Description : Defines a single collision event. One of these is // created for each collision detected by a // CollisionTraverser, to be dealt with by the // CollisionHandler. // -// A qpCollisionEntry provides slots for a number of data +// A CollisionEntry provides slots for a number of data // values (such as intersection point and normal) that // might or might not be known for each collision. It // is up to the handler to determine what information is // known and to do the right thing with it. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionEntry : public TypedReferenceCount { +class EXPCL_PANDA CollisionEntry : public TypedReferenceCount { public: - INLINE qpCollisionEntry(); - qpCollisionEntry(const qpCollisionEntry ©); - void operator = (const qpCollisionEntry ©); + INLINE CollisionEntry(); + CollisionEntry(const CollisionEntry ©); + void operator = (const CollisionEntry ©); PUBLISHED: INLINE const CollisionSolid *get_from() const; INLINE bool has_into() const; INLINE const CollisionSolid *get_into() const; - INLINE qpCollisionNode *get_from_node() const; + INLINE CollisionNode *get_from_node() const; INLINE PandaNode *get_into_node() const; - INLINE const qpNodePath &get_into_node_path() const; + INLINE const NodePath &get_into_node_path() const; INLINE const LMatrix4f &get_from_space() const; INLINE const LMatrix4f &get_into_space() const; @@ -82,9 +82,9 @@ private: CPT(CollisionSolid) _from; CPT(CollisionSolid) _into; - PT(qpCollisionNode) _from_node; + PT(CollisionNode) _from_node; PT(PandaNode) _into_node; - qpNodePath _into_node_path; + NodePath _into_node_path; LMatrix4f _from_space; LMatrix4f _into_space; LMatrix4f _wrt_space; @@ -108,7 +108,7 @@ public: } static void init_type() { TypedReferenceCount::init_type(); - register_type(_type_handle, "qpCollisionEntry", + register_type(_type_handle, "CollisionEntry", TypedReferenceCount::get_class_type()); } virtual TypeHandle get_type() const { @@ -119,10 +119,10 @@ public: private: static TypeHandle _type_handle; - friend class qpCollisionTraverser; + friend class CollisionTraverser; }; -#include "qpcollisionEntry.I" +#include "collisionEntry.I" #endif diff --git a/panda/src/collide/qpcollisionHandler.cxx b/panda/src/collide/collisionHandler.cxx similarity index 82% rename from panda/src/collide/qpcollisionHandler.cxx rename to panda/src/collide/collisionHandler.cxx index b9028e4ee7..e4d894be90 100644 --- a/panda/src/collide/qpcollisionHandler.cxx +++ b/panda/src/collide/collisionHandler.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandler.cxx +// Filename: collisionHandler.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,34 +16,34 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandler.h" +#include "collisionHandler.h" -TypeHandle qpCollisionHandler::_type_handle; +TypeHandle CollisionHandler::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandler::begin_group +// Function: CollisionHandler::begin_group // Access: Public, Virtual // Description: Will be called by the CollisionTraverser before a new // traversal is begun. It instructs the handler to // reset itself in preparation for a number of // CollisionEntries to be sent. //////////////////////////////////////////////////////////////////// -void qpCollisionHandler:: +void CollisionHandler:: begin_group() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandler::add_entry +// Function: CollisionHandler::add_entry // Access: Public, Virtual // Description: Called between a begin_group() .. end_group() // sequence for each collision that is detected. //////////////////////////////////////////////////////////////////// -void qpCollisionHandler:: -add_entry(qpCollisionEntry *) { +void CollisionHandler:: +add_entry(CollisionEntry *) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandler::end_group +// Function: CollisionHandler::end_group // Access: Public, Virtual // Description: Called by the CollisionTraverser at the completion of // all collision detections for this traversal. It @@ -52,10 +52,10 @@ add_entry(qpCollisionEntry *) { // // The return value is normally true, but if this // returns value, the CollisionTraverser will remove the -// handler from its list, allowing the qpCollisionHandler +// handler from its list, allowing the CollisionHandler // itself to determine when it is no longer needed. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandler:: +bool CollisionHandler:: end_group() { return true; } diff --git a/panda/src/collide/qpcollisionHandler.h b/panda/src/collide/collisionHandler.h similarity index 83% rename from panda/src/collide/qpcollisionHandler.h rename to panda/src/collide/collisionHandler.h index 79e2d6ce82..1dbc456429 100644 --- a/panda/src/collide/qpcollisionHandler.h +++ b/panda/src/collide/collisionHandler.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandler.h +// Filename: collisionHandler.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,27 +16,27 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLER_H -#define qpCOLLISIONHANDLER_H +#ifndef COLLISIONHANDLER_H +#define COLLISIONHANDLER_H #include "pandabase.h" #include "typedReferenceCount.h" -class qpCollisionEntry; +class CollisionEntry; /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandler +// Class : CollisionHandler // Description : The abstract interface to a number of classes that // decide what to do what a collision is detected. One // of these must be assigned to the CollisionTraverser // that is processing collisions in order to specify how // to dispatch detected collisions. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandler : public TypedReferenceCount { +class EXPCL_PANDA CollisionHandler : public TypedReferenceCount { public: virtual void begin_group(); - virtual void add_entry(qpCollisionEntry *entry); + virtual void add_entry(CollisionEntry *entry); virtual bool end_group(); @@ -48,7 +48,7 @@ PUBLISHED: public: static void init_type() { TypedReferenceCount::init_type(); - register_type(_type_handle, "qpCollisionHandler", + register_type(_type_handle, "CollisionHandler", TypedReferenceCount::get_class_type()); } virtual TypeHandle get_type() const { diff --git a/panda/src/collide/qpcollisionHandlerEvent.I b/panda/src/collide/collisionHandlerEvent.I similarity index 86% rename from panda/src/collide/qpcollisionHandlerEvent.I rename to panda/src/collide/collisionHandlerEvent.I index b90285ea62..5d688a2bdc 100644 --- a/panda/src/collide/qpcollisionHandlerEvent.I +++ b/panda/src/collide/collisionHandlerEvent.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerEvent.I +// Filename: collisionHandlerEvent.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,15 +18,15 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::SortEntries::operator () +// Function: CollisionHandlerEvent::SortEntries::operator () // Access: Public // Description: Orders the CollisionEntries in the set so that there // is one entry for each node/node intersection // detected. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionHandlerEvent::SortEntries:: -operator () (const PT(qpCollisionEntry) &a, - const PT(qpCollisionEntry) &b) const { +INLINE bool CollisionHandlerEvent::SortEntries:: +operator () (const PT(CollisionEntry) &a, + const PT(CollisionEntry) &b) const { if (a->get_from_node() != b->get_from_node()) { return a->get_from_node() < b->get_from_node(); } @@ -37,19 +37,19 @@ operator () (const PT(qpCollisionEntry) &a, } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::SortEntries::operator = +// Function: CollisionHandlerEvent::SortEntries::operator = // Access: Public // Description: The assignment operator does absolutely nothing, // since this is just a function object class that // stores no data. We define it just to quiet up g++ in // -Wall mode. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerEvent::SortEntries:: -operator = (const qpCollisionHandlerEvent::SortEntries &) { +INLINE void CollisionHandlerEvent::SortEntries:: +operator = (const CollisionHandlerEvent::SortEntries &) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::set_in_pattern +// Function: CollisionHandlerEvent::set_in_pattern // Access: Public // Description: Sets the pattern string that indicates how the event // names are generated for each collision detected. @@ -73,25 +73,25 @@ operator = (const qpCollisionHandlerEvent::SortEntries &) { // in which the collision is no longer detected, the // out_pattern event is thrown. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerEvent:: +INLINE void CollisionHandlerEvent:: set_in_pattern(const string &in_pattern) { _in_pattern = in_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::get_in_pattern +// Function: CollisionHandlerEvent::get_in_pattern // Access: Public // Description: Returns the pattern string that indicates how the // event names are generated for each collision // detected. See set_in_pattern(). //////////////////////////////////////////////////////////////////// -INLINE string qpCollisionHandlerEvent:: +INLINE string CollisionHandlerEvent:: get_in_pattern() const { return _in_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::set_again_pattern +// Function: CollisionHandlerEvent::set_again_pattern // Access: Public // Description: Sets the pattern string that indicates how the event // names are generated when a collision between two @@ -108,27 +108,27 @@ get_in_pattern() const { // in which the collision is no longer detected, the // out_pattern event is thrown. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerEvent:: +INLINE void CollisionHandlerEvent:: set_again_pattern(const string &again_pattern) { _again_pattern = again_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::get_again_pattern +// Function: CollisionHandlerEvent::get_again_pattern // Access: Public // Description: Returns the pattern string that indicates how the // event names are generated when a collision between // two particular nodes is *still* detected. See // set_again_pattern() and set_in_pattern(). //////////////////////////////////////////////////////////////////// -INLINE string qpCollisionHandlerEvent:: +INLINE string CollisionHandlerEvent:: get_again_pattern() const { return _again_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::set_out_pattern +// Function: CollisionHandlerEvent::set_out_pattern // Access: Public // Description: Sets the pattern string that indicates how the event // names are generated when a collision between two @@ -142,20 +142,20 @@ get_again_pattern() const { // in which the collision is no longer detected, the // out_pattern event is thrown. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerEvent:: +INLINE void CollisionHandlerEvent:: set_out_pattern(const string &out_pattern) { _out_pattern = out_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::get_out_pattern +// Function: CollisionHandlerEvent::get_out_pattern // Access: Public // Description: Returns the pattern string that indicates how the // event names are generated when a collision between // two particular nodes is *no longer* detected. See // set_out_pattern() and set_in_pattern(). //////////////////////////////////////////////////////////////////// -INLINE string qpCollisionHandlerEvent:: +INLINE string CollisionHandlerEvent:: get_out_pattern() const { return _out_pattern; } diff --git a/panda/src/collide/qpcollisionHandlerEvent.cxx b/panda/src/collide/collisionHandlerEvent.cxx similarity index 87% rename from panda/src/collide/qpcollisionHandlerEvent.cxx rename to panda/src/collide/collisionHandlerEvent.cxx index 97a34751a7..7dd0df107e 100644 --- a/panda/src/collide/qpcollisionHandlerEvent.cxx +++ b/panda/src/collide/collisionHandlerEvent.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerEvent.cxx +// Filename: collisionHandlerEvent.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,35 +17,35 @@ //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandlerEvent.h" +#include "collisionHandlerEvent.h" #include "config_collide.h" #include "eventParameter.h" #include "throw_event.h" -TypeHandle qpCollisionHandlerEvent::_type_handle; +TypeHandle CollisionHandlerEvent::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::Constructor +// Function: CollisionHandlerEvent::Constructor // Access: Public -// Description: The default qpCollisionHandlerEvent will throw no +// Description: The default CollisionHandlerEvent will throw no // events. Its pattern strings must first be set via a // call to set_in_pattern() and/or set_out_pattern(). //////////////////////////////////////////////////////////////////// -qpCollisionHandlerEvent:: -qpCollisionHandlerEvent() { +CollisionHandlerEvent:: +CollisionHandlerEvent() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::begin_group +// Function: CollisionHandlerEvent::begin_group // Access: Public, Virtual // Description: Will be called by the CollisionTraverser before a new // traversal is begun. It instructs the handler to // reset itself in preparation for a number of // CollisionEntries to be sent. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerEvent:: +void CollisionHandlerEvent:: begin_group() { if (collide_cat.is_spam()) { collide_cat.spam() @@ -56,14 +56,14 @@ begin_group() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::add_entry +// Function: CollisionHandlerEvent::add_entry // Access: Public, Virtual // Description: Called between a begin_group() .. end_group() // sequence for each collision that is detected. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerEvent:: -add_entry(qpCollisionEntry *entry) { - nassertv(entry != (qpCollisionEntry *)NULL); +void CollisionHandlerEvent:: +add_entry(CollisionEntry *entry) { + nassertv(entry != (CollisionEntry *)NULL); // Record this particular entry for later. This will keep track of // all the unique pairs of node/node intersections. @@ -78,14 +78,14 @@ add_entry(qpCollisionEntry *entry) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::end_group +// Function: CollisionHandlerEvent::end_group // Access: Public, Virtual // Description: Called by the CollisionTraverser at the completion of // all collision detections for this traversal. It // should do whatever finalization is required for the // handler. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerEvent:: +bool CollisionHandlerEvent:: end_group() { // Now compare the list of entries we collected this frame with // those we kept from the last time. Each new entry represents a @@ -144,7 +144,7 @@ end_group() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::clear +// Function: CollisionHandlerEvent::clear // Access: Public // Description: Empties the list of elements that all colliders are // known to be colliding with. No "out" events will be @@ -158,19 +158,19 @@ end_group() { // used to set the event that is thrown when a collision // is detected for two or more consecutive frames. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerEvent:: +void CollisionHandlerEvent:: clear() { _last_colliding.clear(); _current_colliding.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerEvent::throw_event_pattern +// Function: CollisionHandlerEvent::throw_event_pattern // Access: Private // Description: Throws an event matching the indicated pattern. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerEvent:: -throw_event_pattern(const string &pattern, qpCollisionEntry *entry) { +void CollisionHandlerEvent:: +throw_event_pattern(const string &pattern, CollisionEntry *entry) { if (pattern.empty()) { return; } diff --git a/panda/src/collide/qpcollisionHandlerEvent.h b/panda/src/collide/collisionHandlerEvent.h similarity index 67% rename from panda/src/collide/qpcollisionHandlerEvent.h rename to panda/src/collide/collisionHandlerEvent.h index f0caac6133..bfa0f308a6 100644 --- a/panda/src/collide/qpcollisionHandlerEvent.h +++ b/panda/src/collide/collisionHandlerEvent.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerEvent.h +// Filename: collisionHandlerEvent.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,33 +16,33 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLEREVENT_H -#define qpCOLLISIONHANDLEREVENT_H +#ifndef COLLISIONHANDLEREVENT_H +#define COLLISIONHANDLEREVENT_H #include "pandabase.h" -#include "qpcollisionHandler.h" -#include "qpcollisionNode.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionNode.h" +#include "collisionEntry.h" #include "pointerTo.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandlerEvent -// Description : A specialized kind of qpCollisionHandler that throws an +// Class : CollisionHandlerEvent +// Description : A specialized kind of CollisionHandler that throws an // event for each collision detected. The event thrown // may be based on the name of the moving object or the // struck object, or both. The first parameter of the -// event will be a pointer to the qpCollisionEntry that +// event will be a pointer to the CollisionEntry that // triggered it. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandlerEvent : public qpCollisionHandler { +class EXPCL_PANDA CollisionHandlerEvent : public CollisionHandler { PUBLISHED: - qpCollisionHandlerEvent(); + CollisionHandlerEvent(); public: virtual void begin_group(); - virtual void add_entry(qpCollisionEntry *entry); + virtual void add_entry(CollisionEntry *entry); virtual bool end_group(); PUBLISHED: @@ -56,7 +56,7 @@ PUBLISHED: void clear(); private: - void throw_event_pattern(const string &pattern, qpCollisionEntry *entry); + void throw_event_pattern(const string &pattern, CollisionEntry *entry); string _in_pattern; string _again_pattern; @@ -67,12 +67,12 @@ private: class SortEntries { public: INLINE bool - operator () (const PT(qpCollisionEntry) &a, - const PT(qpCollisionEntry) &b) const; + operator () (const PT(CollisionEntry) &a, + const PT(CollisionEntry) &b) const; INLINE void operator = (const SortEntries &other); }; - typedef pset Colliding; + typedef pset Colliding; Colliding _current_colliding; Colliding _last_colliding; @@ -81,9 +81,9 @@ public: return _type_handle; } static void init_type() { - qpCollisionHandler::init_type(); - register_type(_type_handle, "qpCollisionHandlerEvent", - qpCollisionHandler::get_class_type()); + CollisionHandler::init_type(); + register_type(_type_handle, "CollisionHandlerEvent", + CollisionHandler::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -94,7 +94,7 @@ private: static TypeHandle _type_handle; }; -#include "qpcollisionHandlerEvent.I" +#include "collisionHandlerEvent.I" #endif diff --git a/panda/src/collide/qpcollisionHandlerFloor.I b/panda/src/collide/collisionHandlerFloor.I similarity index 84% rename from panda/src/collide/qpcollisionHandlerFloor.I rename to panda/src/collide/collisionHandlerFloor.I index c8a665e169..4b4cd44c00 100644 --- a/panda/src/collide/qpcollisionHandlerFloor.I +++ b/panda/src/collide/collisionHandlerFloor.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerFloor.I +// Filename: collisionHandlerFloor.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,50 +18,50 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::set_offset +// Function: CollisionHandlerFloor::set_offset // Access: Public // Description: Sets the linear offset to add to (or subtract from) // the highest detected collision point to determine the // actual height at which to set the collider. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerFloor:: +INLINE void CollisionHandlerFloor:: set_offset(float offset) { _offset = offset; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::get_offset +// Function: CollisionHandlerFloor::get_offset // Access: Public // Description: Returns the linear offset to add to (or subtract from) // the highest detected collision point to determine the // actual height at which to set the collider. //////////////////////////////////////////////////////////////////// -INLINE float qpCollisionHandlerFloor:: +INLINE float CollisionHandlerFloor:: get_offset() const { return _offset; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::set_max_velocity +// Function: CollisionHandlerFloor::set_max_velocity // Access: Public // Description: Sets the maximum speed at which the object will be // allowed to descend towards a floor below it, in units // per second. Set this to zero to allow it to // instantly teleport any distance. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerFloor:: +INLINE void CollisionHandlerFloor:: set_max_velocity(float max_velocity) { _max_velocity = max_velocity; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::get_max_velocity +// Function: CollisionHandlerFloor::get_max_velocity // Access: Public // Description: Retrieves the maximum speed at which the object will // be allowed to descend towards a floor below it, in // units per second. See set_max_velocity(). //////////////////////////////////////////////////////////////////// -INLINE float qpCollisionHandlerFloor:: +INLINE float CollisionHandlerFloor:: get_max_velocity() const { return _max_velocity; } diff --git a/panda/src/collide/qpcollisionHandlerFloor.cxx b/panda/src/collide/collisionHandlerFloor.cxx similarity index 82% rename from panda/src/collide/qpcollisionHandlerFloor.cxx rename to panda/src/collide/collisionHandlerFloor.cxx index bda24e19c6..5b8f451556 100644 --- a/panda/src/collide/qpcollisionHandlerFloor.cxx +++ b/panda/src/collide/collisionHandlerFloor.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerFloor.cxx +// Filename: collisionHandlerFloor.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,37 +16,37 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandlerFloor.h" -#include "qpcollisionNode.h" -#include "qpcollisionEntry.h" +#include "collisionHandlerFloor.h" +#include "collisionNode.h" +#include "collisionEntry.h" #include "config_collide.h" #include "clockObject.h" -TypeHandle qpCollisionHandlerFloor::_type_handle; +TypeHandle CollisionHandlerFloor::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::Constructor +// Function: CollisionHandlerFloor::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerFloor:: -qpCollisionHandlerFloor() { +CollisionHandlerFloor:: +CollisionHandlerFloor() { _offset = 0.0f; _max_velocity = 0.0f; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::Destructor +// Function: CollisionHandlerFloor::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerFloor:: -~qpCollisionHandlerFloor() { +CollisionHandlerFloor:: +~CollisionHandlerFloor() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerFloor::handle_entries +// Function: CollisionHandlerFloor::handle_entries // Access: Protected, Virtual // Description: Called by the parent class after all collisions have // been detected, this manages the various collisions @@ -56,21 +56,21 @@ qpCollisionHandlerFloor:: // false to indicate the CollisionTraverser should // disable this handler from being called in the future. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerFloor:: +bool CollisionHandlerFloor:: handle_entries() { bool okflag = true; FromEntries::const_iterator fi; for (fi = _from_entries.begin(); fi != _from_entries.end(); ++fi) { - qpCollisionNode *from_node = (*fi).first; - nassertr(from_node != (qpCollisionNode *)NULL, false); + CollisionNode *from_node = (*fi).first; + nassertr(from_node != (CollisionNode *)NULL, false); const Entries &entries = (*fi).second; Colliders::iterator ci; ci = _colliders.find(from_node); if (ci == _colliders.end()) { - // Hmm, someone added a qpCollisionNode to a traverser and gave - // it this qpCollisionHandler pointer--but they didn't tell us + // Hmm, someone added a CollisionNode to a traverser and gave + // it this CollisionHandler pointer--but they didn't tell us // about the node. collide_cat.error() << get_type() << " doesn't know about " @@ -92,8 +92,8 @@ handle_entries() { Entries::const_iterator ei; for (ei = entries.begin(); ei != entries.end(); ++ei) { - qpCollisionEntry *entry = (*ei); - nassertr(entry != (qpCollisionEntry *)NULL, false); + CollisionEntry *entry = (*ei); + nassertr(entry != (CollisionEntry *)NULL, false); nassertr(from_node == entry->get_from_node(), false); if (entry->has_from_intersection_point()) { diff --git a/panda/src/collide/qpcollisionHandlerFloor.h b/panda/src/collide/collisionHandlerFloor.h similarity index 73% rename from panda/src/collide/qpcollisionHandlerFloor.h rename to panda/src/collide/collisionHandlerFloor.h index b2ac5d9f88..ad9697efcc 100644 --- a/panda/src/collide/qpcollisionHandlerFloor.h +++ b/panda/src/collide/collisionHandlerFloor.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerFloor.h +// Filename: collisionHandlerFloor.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,26 +16,26 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLERFLOOR_H -#define qpCOLLISIONHANDLERFLOOR_H +#ifndef COLLISIONHANDLERFLOOR_H +#define COLLISIONHANDLERFLOOR_H #include "pandabase.h" -#include "qpcollisionHandlerPhysical.h" +#include "collisionHandlerPhysical.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandlerFloor -// Description : A specialized kind of qpCollisionHandler that sets the +// Class : CollisionHandlerFloor +// Description : A specialized kind of CollisionHandler that sets the // Z height of the collider to a fixed linear offset // from the highest detected collision point each frame. // It's intended to implement walking around on a floor // of varying height by casting a ray down from the // avatar's head. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandlerFloor : public qpCollisionHandlerPhysical { +class EXPCL_PANDA CollisionHandlerFloor : public CollisionHandlerPhysical { PUBLISHED: - qpCollisionHandlerFloor(); - virtual ~qpCollisionHandlerFloor(); + CollisionHandlerFloor(); + virtual ~CollisionHandlerFloor(); INLINE void set_offset(float offset); INLINE float get_offset() const; @@ -56,9 +56,9 @@ public: return _type_handle; } static void init_type() { - qpCollisionHandlerPhysical::init_type(); - register_type(_type_handle, "qpCollisionHandlerFloor", - qpCollisionHandlerPhysical::get_class_type()); + CollisionHandlerPhysical::init_type(); + register_type(_type_handle, "CollisionHandlerFloor", + CollisionHandlerPhysical::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -69,7 +69,7 @@ private: static TypeHandle _type_handle; }; -#include "qpcollisionHandlerFloor.I" +#include "collisionHandlerFloor.I" #endif diff --git a/panda/src/collide/qpcollisionHandlerPhysical.I b/panda/src/collide/collisionHandlerPhysical.I similarity index 73% rename from panda/src/collide/qpcollisionHandlerPhysical.I rename to panda/src/collide/collisionHandlerPhysical.I index 6869192930..4b8a8b93d4 100644 --- a/panda/src/collide/qpcollisionHandlerPhysical.I +++ b/panda/src/collide/collisionHandlerPhysical.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPhysical.I +// Filename: collisionHandlerPhysical.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,35 +18,35 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::ColliderDef::set_drive_interface +// Function: CollisionHandlerPhysical::ColliderDef::set_drive_interface // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerPhysical::ColliderDef:: -set_drive_interface(qpDriveInterface *drive_interface) { +INLINE void CollisionHandlerPhysical::ColliderDef:: +set_drive_interface(DriveInterface *drive_interface) { _drive_interface = drive_interface; _node.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::ColliderDef::set_node +// Function: CollisionHandlerPhysical::ColliderDef::set_node // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerPhysical::ColliderDef:: +INLINE void CollisionHandlerPhysical::ColliderDef:: set_node(PandaNode *node) { _node = node; _drive_interface.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::ColliderDef::is_valid +// Function: CollisionHandlerPhysical::ColliderDef::is_valid // Access: Public // Description: Returns true if this ColliderDef is still valid; // e.g. it refers to a valid node or drive interface. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionHandlerPhysical::ColliderDef:: +INLINE bool CollisionHandlerPhysical::ColliderDef:: is_valid() const { return (_node != (PandaNode *)NULL) || - (_drive_interface != (qpDriveInterface *)NULL); + (_drive_interface != (DriveInterface *)NULL); } diff --git a/panda/src/collide/qpcollisionHandlerPhysical.cxx b/panda/src/collide/collisionHandlerPhysical.cxx similarity index 71% rename from panda/src/collide/qpcollisionHandlerPhysical.cxx rename to panda/src/collide/collisionHandlerPhysical.cxx index 8ebc5d60d8..b04a7cd133 100644 --- a/panda/src/collide/qpcollisionHandlerPhysical.cxx +++ b/panda/src/collide/collisionHandlerPhysical.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPhysical.cxx +// Filename: collisionHandlerPhysical.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,97 +16,97 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandlerPhysical.h" +#include "collisionHandlerPhysical.h" #include "config_collide.h" #include "transformState.h" -TypeHandle qpCollisionHandlerPhysical::_type_handle; +TypeHandle CollisionHandlerPhysical::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::ColliderDef::get_mat +// Function: CollisionHandlerPhysical::ColliderDef::get_mat // Access: Public // Description: Fills mat with the matrix representing the current // position and orientation of this collider. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical::ColliderDef:: +void CollisionHandlerPhysical::ColliderDef:: get_mat(LMatrix4f &mat) const { if (_node != (PandaNode *)NULL) { mat = _node->get_transform()->get_mat(); - } else if (_drive_interface != (qpDriveInterface *)NULL) { + } else if (_drive_interface != (DriveInterface *)NULL) { mat = _drive_interface->get_mat(); } else { collide_cat.error() - << "Invalid qpCollisionHandlerPhysical::ColliderDef\n"; + << "Invalid CollisionHandlerPhysical::ColliderDef\n"; } } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::ColliderDef::set_mat +// Function: CollisionHandlerPhysical::ColliderDef::set_mat // Access: Public // Description: Moves this collider to the position and orientation // indicated by the given transform. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical::ColliderDef:: +void CollisionHandlerPhysical::ColliderDef:: set_mat(const LMatrix4f &mat) { if (_node != (PandaNode *)NULL) { _node->set_transform(TransformState::make_mat(mat)); - } else if (_drive_interface != (qpDriveInterface *)NULL) { + } else if (_drive_interface != (DriveInterface *)NULL) { _drive_interface->set_mat(mat); _drive_interface->force_dgraph(); } else { collide_cat.error() - << "Invalid qpCollisionHandlerPhysical::ColliderDef\n"; + << "Invalid CollisionHandlerPhysical::ColliderDef\n"; } } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::Constructor +// Function: CollisionHandlerPhysical::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerPhysical:: -qpCollisionHandlerPhysical() { +CollisionHandlerPhysical:: +CollisionHandlerPhysical() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::Destructor +// Function: CollisionHandlerPhysical::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerPhysical:: -~qpCollisionHandlerPhysical() { +CollisionHandlerPhysical:: +~CollisionHandlerPhysical() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::begin_group +// Function: CollisionHandlerPhysical::begin_group // Access: Public, Virtual // Description: Will be called by the CollisionTraverser before a new // traversal is begun. It instructs the handler to // reset itself in preparation for a number of // CollisionEntries to be sent. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical:: +void CollisionHandlerPhysical:: begin_group() { - qpCollisionHandlerEvent::begin_group(); + CollisionHandlerEvent::begin_group(); _from_entries.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::add_entry +// Function: CollisionHandlerPhysical::add_entry // Access: Public, Virtual // Description: Called between a begin_group() .. end_group() // sequence for each collision that is detected. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical:: -add_entry(qpCollisionEntry *entry) { - nassertv(entry != (qpCollisionEntry *)NULL); - qpCollisionHandlerEvent::add_entry(entry); +void CollisionHandlerPhysical:: +add_entry(CollisionEntry *entry) { + nassertv(entry != (CollisionEntry *)NULL); + CollisionHandlerEvent::add_entry(entry); if (entry->get_from()->is_tangible() && (!entry->has_into() || entry->get_into()->is_tangible())) { @@ -115,54 +115,54 @@ add_entry(qpCollisionEntry *entry) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::end_group +// Function: CollisionHandlerPhysical::end_group // Access: Public, Virtual // Description: Called by the CollisionTraverser at the completion of // all collision detections for this traversal. It // should do whatever finalization is required for the // handler. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerPhysical:: +bool CollisionHandlerPhysical:: end_group() { - qpCollisionHandlerEvent::end_group(); + CollisionHandlerEvent::end_group(); return handle_entries(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::add_collider_drive +// Function: CollisionHandlerPhysical::add_collider_drive // Access: Public -// Description: Adds a new collider to the list with a qpDriveInterface +// Description: Adds a new collider to the list with a DriveInterface // pointer that needs to be told about the collider's // new position, or updates the existing collider with a -// new qpDriveInterface pointer. +// new DriveInterface pointer. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical:: -add_collider_drive(qpCollisionNode *node, qpDriveInterface *drive_interface) { +void CollisionHandlerPhysical:: +add_collider_drive(CollisionNode *node, DriveInterface *drive_interface) { _colliders[node].set_drive_interface(drive_interface); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::add_collider_node +// Function: CollisionHandlerPhysical::add_collider_node // Access: Public // Description: Adds a new collider to the list with a PandaNode // pointer that will be updated with the collider's // new position, or updates the existing collider with a // new PandaNode pointer. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical:: -add_collider_node(qpCollisionNode *node, PandaNode *target) { +void CollisionHandlerPhysical:: +add_collider_node(CollisionNode *node, PandaNode *target) { _colliders[node].set_node(target); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::remove_collider +// Function: CollisionHandlerPhysical::remove_collider // Access: Public // Description: Removes the collider from the list of colliders that // this handler knows about. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerPhysical:: -remove_collider(qpCollisionNode *node) { +bool CollisionHandlerPhysical:: +remove_collider(CollisionNode *node) { Colliders::iterator ci = _colliders.find(node); if (ci == _colliders.end()) { return false; @@ -172,24 +172,24 @@ remove_collider(qpCollisionNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::has_collider +// Function: CollisionHandlerPhysical::has_collider // Access: Public // Description: Returns true if the handler knows about the indicated // collider, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerPhysical:: -has_collider(qpCollisionNode *node) const { +bool CollisionHandlerPhysical:: +has_collider(CollisionNode *node) const { Colliders::const_iterator ci = _colliders.find(node); return (ci != _colliders.end()); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPhysical::clear_colliders +// Function: CollisionHandlerPhysical::clear_colliders // Access: Public // Description: Completely empties the list of colliders this handler // knows about. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerPhysical:: +void CollisionHandlerPhysical:: clear_colliders() { _colliders.clear(); } diff --git a/panda/src/collide/qpcollisionHandlerPhysical.h b/panda/src/collide/collisionHandlerPhysical.h similarity index 58% rename from panda/src/collide/qpcollisionHandlerPhysical.h rename to panda/src/collide/collisionHandlerPhysical.h index de667f0279..fc9f6600ca 100644 --- a/panda/src/collide/qpcollisionHandlerPhysical.h +++ b/panda/src/collide/collisionHandlerPhysical.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPhysical.h +// Filename: collisionHandlerPhysical.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,63 +16,63 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLERPHYSICAL_H -#define qpCOLLISIONHANDLERPHYSICAL_H +#ifndef COLLISIONHANDLERPHYSICAL_H +#define COLLISIONHANDLERPHYSICAL_H #include "pandabase.h" -#include "qpcollisionHandlerEvent.h" -#include "qpcollisionNode.h" +#include "collisionHandlerEvent.h" +#include "collisionNode.h" -#include "qpdriveInterface.h" +#include "driveInterface.h" #include "pointerTo.h" #include "pandaNode.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandlerPhysical +// Class : CollisionHandlerPhysical // Description : The abstract base class for a number of -// qpCollisionHandlers that have some physical effect on +// CollisionHandlers that have some physical effect on // their moving bodies: they need to update the nodes' // positions based on the effects of the collision. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandlerPhysical : public qpCollisionHandlerEvent { +class EXPCL_PANDA CollisionHandlerPhysical : public CollisionHandlerEvent { public: - qpCollisionHandlerPhysical(); - virtual ~qpCollisionHandlerPhysical(); + CollisionHandlerPhysical(); + virtual ~CollisionHandlerPhysical(); virtual void begin_group(); - virtual void add_entry(qpCollisionEntry *entry); + virtual void add_entry(CollisionEntry *entry); virtual bool end_group(); PUBLISHED: - void add_collider_drive(qpCollisionNode *node, qpDriveInterface *drive_interface); - void add_collider_node(qpCollisionNode *node, PandaNode *target); - bool remove_collider(qpCollisionNode *node); - bool has_collider(qpCollisionNode *node) const; + void add_collider_drive(CollisionNode *node, DriveInterface *drive_interface); + void add_collider_node(CollisionNode *node, PandaNode *target); + bool remove_collider(CollisionNode *node); + bool has_collider(CollisionNode *node) const; void clear_colliders(); protected: virtual bool handle_entries()=0; protected: - typedef pvector< PT(qpCollisionEntry) > Entries; - typedef pmap FromEntries; + typedef pvector< PT(CollisionEntry) > Entries; + typedef pmap FromEntries; FromEntries _from_entries; class ColliderDef { public: - INLINE void set_drive_interface(qpDriveInterface *drive_interface); + INLINE void set_drive_interface(DriveInterface *drive_interface); INLINE void set_node(PandaNode *node); INLINE bool is_valid() const; void get_mat(LMatrix4f &mat) const; void set_mat(const LMatrix4f &mat); - PT(qpDriveInterface) _drive_interface; + PT(DriveInterface) _drive_interface; PT(PandaNode) _node; }; - typedef pmap Colliders; + typedef pmap Colliders; Colliders _colliders; @@ -81,9 +81,9 @@ public: return _type_handle; } static void init_type() { - qpCollisionHandlerEvent::init_type(); - register_type(_type_handle, "qpCollisionHandlerPhysical", - qpCollisionHandlerEvent::get_class_type()); + CollisionHandlerEvent::init_type(); + register_type(_type_handle, "CollisionHandlerPhysical", + CollisionHandlerEvent::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -94,7 +94,7 @@ private: static TypeHandle _type_handle; }; -#include "qpcollisionHandlerPhysical.I" +#include "collisionHandlerPhysical.I" #endif diff --git a/panda/src/collide/qpcollisionHandlerPusher.I b/panda/src/collide/collisionHandlerPusher.I similarity index 82% rename from panda/src/collide/qpcollisionHandlerPusher.I rename to panda/src/collide/collisionHandlerPusher.I index 4283a99b14..21899b80fd 100644 --- a/panda/src/collide/qpcollisionHandlerPusher.I +++ b/panda/src/collide/collisionHandlerPusher.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPusher.I +// Filename: collisionHandlerPusher.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,21 +18,21 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPusher::set_horizontal +// Function: CollisionHandlerPusher::set_horizontal // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionHandlerPusher:: +INLINE void CollisionHandlerPusher:: set_horizontal(bool flag) { _horizontal = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPusher::get_horizontal +// Function: CollisionHandlerPusher::get_horizontal // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionHandlerPusher:: +INLINE bool CollisionHandlerPusher:: get_horizontal() const { return _horizontal; } diff --git a/panda/src/collide/qpcollisionHandlerPusher.cxx b/panda/src/collide/collisionHandlerPusher.cxx similarity index 82% rename from panda/src/collide/qpcollisionHandlerPusher.cxx rename to panda/src/collide/collisionHandlerPusher.cxx index b69fc9464c..d484ebc90a 100644 --- a/panda/src/collide/qpcollisionHandlerPusher.cxx +++ b/panda/src/collide/collisionHandlerPusher.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPusher.cxx +// Filename: collisionHandlerPusher.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,21 +16,21 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandlerPusher.h" -#include "qpcollisionNode.h" -#include "qpcollisionEntry.h" +#include "collisionHandlerPusher.h" +#include "collisionNode.h" +#include "collisionEntry.h" #include "config_collide.h" -TypeHandle qpCollisionHandlerPusher::_type_handle; +TypeHandle CollisionHandlerPusher::_type_handle; /////////////////////////////////////////////////////////////////// -// Class : qpShoveData -// Description : The qpShoveData class is used within -// qpCollisionHandlerPusher::handle_entries(), to track +// Class : ShoveData +// Description : The ShoveData class is used within +// CollisionHandlerPusher::handle_entries(), to track // multiple shoves onto a given collider. It's not // exported outside this file. //////////////////////////////////////////////////////////////////// -class qpShoveData { +class ShoveData { public: LVector3f _shove; float _length; @@ -39,26 +39,26 @@ public: }; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPusher::Constructor +// Function: CollisionHandlerPusher::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerPusher:: -qpCollisionHandlerPusher() { +CollisionHandlerPusher:: +CollisionHandlerPusher() { _horizontal = true; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPusher::Destructor +// Function: CollisionHandlerPusher::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerPusher:: -~qpCollisionHandlerPusher() { +CollisionHandlerPusher:: +~CollisionHandlerPusher() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerPusher::handle_entries +// Function: CollisionHandlerPusher::handle_entries // Access: Protected, Virtual // Description: Called by the parent class after all collisions have // been detected, this manages the various collisions @@ -68,24 +68,24 @@ qpCollisionHandlerPusher:: // false to indicate the CollisionTraverser should // disable this handler from being called in the future. //////////////////////////////////////////////////////////////////// -bool qpCollisionHandlerPusher:: +bool CollisionHandlerPusher:: handle_entries() { bool okflag = true; FromEntries::const_iterator fi; for (fi = _from_entries.begin(); fi != _from_entries.end(); ++fi) { - qpCollisionNode *from_node = (*fi).first; - nassertr(from_node != (qpCollisionNode *)NULL, false); + CollisionNode *from_node = (*fi).first; + nassertr(from_node != (CollisionNode *)NULL, false); const Entries &entries = (*fi).second; Colliders::iterator ci; ci = _colliders.find(from_node); if (ci == _colliders.end()) { - // Hmm, someone added a qpCollisionNode to a traverser and gave - // it this qpCollisionHandler pointer--but they didn't tell us + // Hmm, someone added a CollisionNode to a traverser and gave + // it this CollisionHandler pointer--but they didn't tell us // about the node. collide_cat.error() - << "qpCollisionHandlerPusher doesn't know about " + << "CollisionHandlerPusher doesn't know about " << *from_node << ", disabling.\n"; okflag = false; @@ -106,13 +106,13 @@ handle_entries() { // share nearly the same direction, and if so, we keep only the // longer of the two. - typedef pvector Shoves; + typedef pvector Shoves; Shoves shoves; Entries::const_iterator ei; for (ei = entries.begin(); ei != entries.end(); ++ei) { - qpCollisionEntry *entry = (*ei); - nassertr(entry != (qpCollisionEntry *)NULL, false); + CollisionEntry *entry = (*ei); + nassertr(entry != (CollisionEntry *)NULL, false); nassertr(from_node == entry->get_from_node(), false); if (!entry->has_into_surface_normal() || @@ -126,7 +126,7 @@ handle_entries() { } else { // Shove it just enough to clear the volume. if (entry->get_into_depth() != 0.0f) { - qpShoveData sd; + ShoveData sd; sd._shove = entry->get_into_surface_normal() * entry->get_into_depth(); @@ -152,10 +152,10 @@ handle_entries() { Shoves::iterator si; for (si = shoves.begin(); si != shoves.end(); ++si) { - qpShoveData &sd = (*si); + ShoveData &sd = (*si); Shoves::iterator sj; for (sj = shoves.begin(); sj != si; ++sj) { - qpShoveData &sd2 = (*sj); + ShoveData &sd2 = (*sj); if (sd2._valid) { float d = sd._normalized_shove.dot(sd2._normalized_shove); @@ -180,7 +180,7 @@ handle_entries() { // Now we can determine the net shove. LVector3f net_shove(0.0f, 0.0f, 0.0f); for (si = shoves.begin(); si != shoves.end(); ++si) { - const qpShoveData &sd = (*si); + const ShoveData &sd = (*si); if (sd._valid) { net_shove += sd._shove; } diff --git a/panda/src/collide/qpcollisionHandlerPusher.h b/panda/src/collide/collisionHandlerPusher.h similarity index 70% rename from panda/src/collide/qpcollisionHandlerPusher.h rename to panda/src/collide/collisionHandlerPusher.h index 284d877fb5..d1362e77ca 100644 --- a/panda/src/collide/qpcollisionHandlerPusher.h +++ b/panda/src/collide/collisionHandlerPusher.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerPusher.h +// Filename: collisionHandlerPusher.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,24 +16,24 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLERPUSHER_H -#define qpCOLLISIONHANDLERPUSHER_H +#ifndef COLLISIONHANDLERPUSHER_H +#define COLLISIONHANDLERPUSHER_H #include "pandabase.h" -#include "qpcollisionHandlerPhysical.h" +#include "collisionHandlerPhysical.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandlerPusher -// Description : A specialized kind of qpCollisionHandler that simply +// Class : CollisionHandlerPusher +// Description : A specialized kind of CollisionHandler that simply // pushes back on things that attempt to move into solid // walls. This is the simplest kind of "real-world" // collisions you can have. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandlerPusher : public qpCollisionHandlerPhysical { +class EXPCL_PANDA CollisionHandlerPusher : public CollisionHandlerPhysical { PUBLISHED: - qpCollisionHandlerPusher(); - virtual ~qpCollisionHandlerPusher(); + CollisionHandlerPusher(); + virtual ~CollisionHandlerPusher(); INLINE void set_horizontal(bool flag); INLINE bool get_horizontal() const; @@ -50,9 +50,9 @@ public: return _type_handle; } static void init_type() { - qpCollisionHandlerPhysical::init_type(); - register_type(_type_handle, "qpCollisionHandlerPusher", - qpCollisionHandlerPhysical::get_class_type()); + CollisionHandlerPhysical::init_type(); + register_type(_type_handle, "CollisionHandlerPusher", + CollisionHandlerPhysical::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -63,7 +63,7 @@ private: static TypeHandle _type_handle; }; -#include "qpcollisionHandlerPusher.I" +#include "collisionHandlerPusher.I" #endif diff --git a/panda/src/collide/qpcollisionHandlerQueue.cxx b/panda/src/collide/collisionHandlerQueue.cxx similarity index 77% rename from panda/src/collide/qpcollisionHandlerQueue.cxx rename to panda/src/collide/collisionHandlerQueue.cxx index 7cfebf93bd..f7d06a3fc2 100644 --- a/panda/src/collide/qpcollisionHandlerQueue.cxx +++ b/panda/src/collide/collisionHandlerQueue.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerQueue.cxx +// Filename: collisionHandlerQueue.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,65 +16,65 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionHandlerQueue.h" +#include "collisionHandlerQueue.h" #include "config_collide.h" -TypeHandle qpCollisionHandlerQueue::_type_handle; +TypeHandle CollisionHandlerQueue::_type_handle; // This class is used in sort_entries(), below. -class qpCollisionEntrySorter { +class CollisionEntrySorter { public: - qpCollisionEntrySorter(qpCollisionEntry *entry) { + CollisionEntrySorter(CollisionEntry *entry) { _entry = entry; LVector3f vec = entry->get_from_intersection_point() - entry->get_from()->get_collision_origin(); _dist2 = vec.length_squared(); } - bool operator < (const qpCollisionEntrySorter &other) const { + bool operator < (const CollisionEntrySorter &other) const { return _dist2 < other._dist2; } - qpCollisionEntry *_entry; + CollisionEntry *_entry; float _dist2; }; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::Constructor +// Function: CollisionHandlerQueue::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionHandlerQueue:: -qpCollisionHandlerQueue() { +CollisionHandlerQueue:: +CollisionHandlerQueue() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::begin_group +// Function: CollisionHandlerQueue::begin_group // Access: Public, Virtual // Description: Will be called by the CollisionTraverser before a new // traversal is begun. It instructs the handler to // reset itself in preparation for a number of // CollisionEntries to be sent. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerQueue:: +void CollisionHandlerQueue:: begin_group() { _entries.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::add_entry +// Function: CollisionHandlerQueue::add_entry // Access: Public, Virtual // Description: Called between a begin_group() .. end_group() // sequence for each collision that is detected. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerQueue:: -add_entry(qpCollisionEntry *entry) { - nassertv(entry != (qpCollisionEntry *)NULL); +void CollisionHandlerQueue:: +add_entry(CollisionEntry *entry) { + nassertv(entry != (CollisionEntry *)NULL); _entries.push_back(entry); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::sort_entries +// Function: CollisionHandlerQueue::sort_entries // Access: Public // Description: Sorts all the detected collisions front-to-back by // from_intersection_point() so that those intersection @@ -82,17 +82,17 @@ add_entry(qpCollisionEntry *entry) { // center of the CollisionSphere, or the point_a of a // CollisionSegment) appear first. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerQueue:: +void CollisionHandlerQueue:: sort_entries() { // Build up a temporary vector of entries so we can sort the // pointers. This uses the class defined above. - typedef pvector Sorter; + typedef pvector Sorter; Sorter sorter; sorter.reserve(_entries.size()); Entries::const_iterator ei; for (ei = _entries.begin(); ei != _entries.end(); ++ei) { - sorter.push_back(qpCollisionEntrySorter(*ei)); + sorter.push_back(CollisionEntrySorter(*ei)); } sort(sorter.begin(), sorter.end()); @@ -112,32 +112,32 @@ sort_entries() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::clear_entries +// Function: CollisionHandlerQueue::clear_entries // Access: Public // Description: Removes all the entries from the queue. //////////////////////////////////////////////////////////////////// -void qpCollisionHandlerQueue:: +void CollisionHandlerQueue:: clear_entries() { _entries.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::get_num_entries +// Function: CollisionHandlerQueue::get_num_entries // Access: Public // Description: Returns the number of CollisionEntries detected last // pass. //////////////////////////////////////////////////////////////////// -int qpCollisionHandlerQueue:: +int CollisionHandlerQueue:: get_num_entries() const { return _entries.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionHandlerQueue::get_entry +// Function: CollisionHandlerQueue::get_entry // Access: Public -// Description: Returns the nth qpCollisionEntry detected last pass. +// Description: Returns the nth CollisionEntry detected last pass. //////////////////////////////////////////////////////////////////// -qpCollisionEntry *qpCollisionHandlerQueue:: +CollisionEntry *CollisionHandlerQueue:: get_entry(int n) const { nassertr(n >= 0 && n < (int)_entries.size(), NULL); return _entries[n]; diff --git a/panda/src/collide/qpcollisionHandlerQueue.h b/panda/src/collide/collisionHandlerQueue.h similarity index 70% rename from panda/src/collide/qpcollisionHandlerQueue.h rename to panda/src/collide/collisionHandlerQueue.h index 2ee9c70701..5f39a04a6b 100644 --- a/panda/src/collide/qpcollisionHandlerQueue.h +++ b/panda/src/collide/collisionHandlerQueue.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionHandlerQueue.h +// Filename: collisionHandlerQueue.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,40 +16,40 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONHANDLERQUEUE_H -#define qpCOLLISIONHANDLERQUEUE_H +#ifndef COLLISIONHANDLERQUEUE_H +#define COLLISIONHANDLERQUEUE_H #include -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" /////////////////////////////////////////////////////////////////// -// Class : qpCollisionHandlerQueue -// Description : A special kind of qpCollisionHandler that does nothing +// Class : CollisionHandlerQueue +// Description : A special kind of CollisionHandler that does nothing // except remember the CollisionEntries detected the // last pass. This set of CollisionEntries may then be // queried by the calling function. It's primarily // useful when a simple intersection test is being made, // e.g. for picking from the window. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionHandlerQueue : public qpCollisionHandler { +class EXPCL_PANDA CollisionHandlerQueue : public CollisionHandler { PUBLISHED: - qpCollisionHandlerQueue(); + CollisionHandlerQueue(); public: virtual void begin_group(); - virtual void add_entry(qpCollisionEntry *entry); + virtual void add_entry(CollisionEntry *entry); PUBLISHED: void sort_entries(); void clear_entries(); int get_num_entries() const; - qpCollisionEntry *get_entry(int n) const; + CollisionEntry *get_entry(int n) const; private: - typedef pvector< PT(qpCollisionEntry) > Entries; + typedef pvector< PT(CollisionEntry) > Entries; Entries _entries; public: @@ -57,9 +57,9 @@ public: return _type_handle; } static void init_type() { - qpCollisionHandler::init_type(); - register_type(_type_handle, "qpCollisionHandlerQueue", - qpCollisionHandler::get_class_type()); + CollisionHandler::init_type(); + register_type(_type_handle, "CollisionHandlerQueue", + CollisionHandler::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/collide/qpcollisionLevelState.I b/panda/src/collide/collisionLevelState.I similarity index 80% rename from panda/src/collide/qpcollisionLevelState.I rename to panda/src/collide/collisionLevelState.I index a8a3e47f7f..1b8862718a 100644 --- a/panda/src/collide/qpcollisionLevelState.I +++ b/panda/src/collide/collisionLevelState.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionLevelState.I +// Filename: collisionLevelState.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,24 +18,24 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::Constructor +// Function: CollisionLevelState::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpCollisionLevelState:: -qpCollisionLevelState(const qpNodePath &node_path) : +INLINE CollisionLevelState:: +CollisionLevelState(const NodePath &node_path) : _node_path(node_path) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::Constructor +// Function: CollisionLevelState::Constructor // Access: Public // Description: This constructor goes to the next child node in the // traversal. //////////////////////////////////////////////////////////////////// -INLINE qpCollisionLevelState:: -qpCollisionLevelState(const qpCollisionLevelState &parent, PandaNode *child) : +INLINE CollisionLevelState:: +CollisionLevelState(const CollisionLevelState &parent, PandaNode *child) : _node_path(parent._node_path, child), _colliders(parent._colliders), _current(parent._current), @@ -45,85 +45,85 @@ qpCollisionLevelState(const qpCollisionLevelState &parent, PandaNode *child) : } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_node_path +// Function: CollisionLevelState::get_node_path // Access: Public // Description: Returns the NodePath representing the node instance // we have traversed to. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpCollisionLevelState:: +INLINE NodePath CollisionLevelState:: get_node_path() const { return _node_path.get_node_path(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::node +// Function: CollisionLevelState::node // Access: Public // Description: Returns the PandaNode pointer of the node we have // traversed to. //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpCollisionLevelState:: +INLINE PandaNode *CollisionLevelState:: node() const { return _node_path.node(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_num_colliders +// Function: CollisionLevelState::get_num_colliders // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE int qpCollisionLevelState:: +INLINE int CollisionLevelState:: get_num_colliders() const { return _colliders.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::has_collider +// Function: CollisionLevelState::has_collider // Access: Public // Description: Returns true if the nth collider in the LevelState is // still part of the level. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionLevelState:: +INLINE bool CollisionLevelState:: has_collider(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), false); return (_current & get_mask(n)) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::has_collider_with_geom +// Function: CollisionLevelState::has_collider_with_geom // Access: Public // Description: Returns true if the nth collider in the LevelState is // still part of the level, and it has the // "collide_geom" flag set. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionLevelState:: +INLINE bool CollisionLevelState:: has_collider_with_geom(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), false); return (_current & _colliders_with_geom & get_mask(n)) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::has_any_collider +// Function: CollisionLevelState::has_any_collider // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionLevelState:: +INLINE bool CollisionLevelState:: has_any_collider() const { return _current != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::has_any_collide_geom +// Function: CollisionLevelState::has_any_collide_geom // Access: Public // Description: Returns true if any Collider in the level state has // the "collide_geom" flag set, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionLevelState:: +INLINE bool CollisionLevelState:: has_any_collide_geom() const { return (_current & _colliders_with_geom) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::reached_collision_node +// Function: CollisionLevelState::reached_collision_node // Access: Public // Description: Called by the traverser when we reach a CollisionNode // in the traversal. At this point, we zero out our set @@ -131,17 +131,17 @@ has_any_collide_geom() const { // because no colliders will test against geometry // parented beneath a CollisionNode. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionLevelState:: +INLINE void CollisionLevelState:: reached_collision_node() { _colliders_with_geom = 0; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_collider +// Function: CollisionLevelState::get_collider // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE CollisionSolid *qpCollisionLevelState:: +INLINE CollisionSolid *CollisionLevelState:: get_collider(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), NULL); nassertr(has_collider(n), NULL); @@ -150,11 +150,11 @@ get_collider(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_node +// Function: CollisionLevelState::get_node // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpCollisionNode *qpCollisionLevelState:: +INLINE CollisionNode *CollisionLevelState:: get_node(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), NULL); nassertr(has_collider(n), NULL); @@ -163,11 +163,11 @@ get_node(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_space +// Function: CollisionLevelState::get_space // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionLevelState:: +INLINE const LMatrix4f &CollisionLevelState:: get_space(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), LMatrix4f::ident_mat()); nassertr(has_collider(n), LMatrix4f::ident_mat()); @@ -176,11 +176,11 @@ get_space(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_inv_space +// Function: CollisionLevelState::get_inv_space // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpCollisionLevelState:: +INLINE const LMatrix4f &CollisionLevelState:: get_inv_space(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), LMatrix4f::ident_mat()); nassertr(has_collider(n), LMatrix4f::ident_mat()); @@ -189,13 +189,13 @@ get_inv_space(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_local_bound +// Function: CollisionLevelState::get_local_bound // Access: Public // Description: Returns the bounding volume of the indicated // collider, transformed into the current node's // transform space. //////////////////////////////////////////////////////////////////// -INLINE const GeometricBoundingVolume *qpCollisionLevelState:: +INLINE const GeometricBoundingVolume *CollisionLevelState:: get_local_bound(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), NULL); nassertr(has_collider(n), NULL); @@ -210,7 +210,7 @@ get_local_bound(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_parent_bound +// Function: CollisionLevelState::get_parent_bound // Access: Public // Description: Returns the bounding volume of the indicated // collider, transformed into the previous node's @@ -220,7 +220,7 @@ get_local_bound(int n) const { // (which does not have its own transform applied to // it). //////////////////////////////////////////////////////////////////// -INLINE const GeometricBoundingVolume *qpCollisionLevelState:: +INLINE const GeometricBoundingVolume *CollisionLevelState:: get_parent_bound(int n) const { nassertr(n >= 0 && n < (int)_colliders.size(), NULL); nassertr(has_collider(n), NULL); @@ -231,11 +231,11 @@ get_parent_bound(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::omit_collider +// Function: CollisionLevelState::omit_collider // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionLevelState:: +INLINE void CollisionLevelState:: omit_collider(int n) { nassertv(n >= 0 && n < (int)_colliders.size()); nassertv(has_collider(n)); @@ -244,12 +244,12 @@ omit_collider(int n) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::get_mask +// Function: CollisionLevelState::get_mask // Access: Private // Description: Returns a single bit associated with the nth // collider. //////////////////////////////////////////////////////////////////// -INLINE qpCollisionLevelState::ColliderMask qpCollisionLevelState:: +INLINE CollisionLevelState::ColliderMask CollisionLevelState:: get_mask(int n) const { return ((ColliderMask)1) << n; } diff --git a/panda/src/collide/qpcollisionLevelState.cxx b/panda/src/collide/collisionLevelState.cxx similarity index 92% rename from panda/src/collide/qpcollisionLevelState.cxx rename to panda/src/collide/collisionLevelState.cxx index 4a116e72b1..9e1826ec00 100644 --- a/panda/src/collide/qpcollisionLevelState.cxx +++ b/panda/src/collide/collisionLevelState.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionLevelState.cxx +// Filename: collisionLevelState.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,16 +16,16 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionLevelState.h" +#include "collisionLevelState.h" #include "collisionSolid.h" #include "dcast.h" //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::clear +// Function: CollisionLevelState::clear // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionLevelState:: +void CollisionLevelState:: clear() { _colliders.clear(); _local_bounds.clear(); @@ -35,23 +35,23 @@ clear() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::reserve +// Function: CollisionLevelState::reserve // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionLevelState:: +void CollisionLevelState:: reserve(int max_colliders) { _colliders.reserve(max_colliders); _local_bounds.reserve(max_colliders); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::prepare_collider +// Function: CollisionLevelState::prepare_collider // Access: Public // Description: Adds the indicated Collider to the set of Colliders // in the current level state. //////////////////////////////////////////////////////////////////// -void qpCollisionLevelState:: +void CollisionLevelState:: prepare_collider(const ColliderDef &def) { int index = (int)_colliders.size(); _colliders.push_back(def); @@ -76,7 +76,7 @@ prepare_collider(const ColliderDef &def) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::any_in_bounds +// Function: CollisionLevelState::any_in_bounds // Access: Public // Description: Checks the bounding volume of the current node // against each of our colliders. Eliminates from the @@ -85,7 +85,7 @@ prepare_collider(const ColliderDef &def) { // remain, false if all of them fall outside this node's // bounding volume. //////////////////////////////////////////////////////////////////// -bool qpCollisionLevelState:: +bool CollisionLevelState:: any_in_bounds() { #ifndef NDEBUG int indent_level = 0; @@ -105,7 +105,7 @@ any_in_bounds() { int num_colliders = get_num_colliders(); for (int c = 0; c < num_colliders; c++) { if (has_collider(c)) { - qpCollisionNode *collider = get_node(c); + CollisionNode *collider = get_node(c); bool is_in = false; // Don't even bother testing the bounding volume if there are @@ -161,12 +161,12 @@ any_in_bounds() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionLevelState::apply_transform +// Function: CollisionLevelState::apply_transform // Access: Public // Description: Applies the inverse transform from the current node, // if any, onto all the colliders in the level state. //////////////////////////////////////////////////////////////////// -void qpCollisionLevelState:: +void CollisionLevelState:: apply_transform() { // The "parent" bounds list remembers the bounds list of the // previous node. diff --git a/panda/src/collide/qpcollisionLevelState.h b/panda/src/collide/collisionLevelState.h similarity index 84% rename from panda/src/collide/qpcollisionLevelState.h rename to panda/src/collide/collisionLevelState.h index 8a1244c7c7..a986cbd2c3 100644 --- a/panda/src/collide/qpcollisionLevelState.h +++ b/panda/src/collide/collisionLevelState.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionLevelState.h +// Filename: collisionLevelState.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,40 +16,40 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONLEVELSTATE_H -#define qpCOLLISIONLEVELSTATE_H +#ifndef COLLISIONLEVELSTATE_H +#define COLLISIONLEVELSTATE_H #include "pandabase.h" #include "luse.h" #include "pointerToArray.h" #include "geometricBoundingVolume.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "workingNodePath.h" #include "plist.h" class CollisionSolid; -class qpCollisionNode; +class CollisionNode; //////////////////////////////////////////////////////////////////// -// Class : qpCollisionLevelState +// Class : CollisionLevelState // Description : This is the state information the // CollisionTraverser retains for each level during // traversal. //////////////////////////////////////////////////////////////////// -class qpCollisionLevelState { +class CollisionLevelState { public: class ColliderDef { public: CollisionSolid *_collider; - qpCollisionNode *_node; + CollisionNode *_node; LMatrix4f _space; LMatrix4f _inv_space; }; - INLINE qpCollisionLevelState(const qpNodePath &node_path); - INLINE qpCollisionLevelState(const qpCollisionLevelState &parent, + INLINE CollisionLevelState(const NodePath &node_path); + INLINE CollisionLevelState(const CollisionLevelState &parent, PandaNode *child); void clear(); @@ -59,7 +59,7 @@ public: bool any_in_bounds(); void apply_transform(); - INLINE qpNodePath get_node_path() const; + INLINE NodePath get_node_path() const; INLINE PandaNode *node() const; INLINE int get_num_colliders() const; @@ -71,7 +71,7 @@ public: INLINE void reached_collision_node(); INLINE CollisionSolid *get_collider(int n) const; - INLINE qpCollisionNode *get_node(int n) const; + INLINE CollisionNode *get_node(int n) const; INLINE const LMatrix4f &get_space(int n) const; INLINE const LMatrix4f &get_inv_space(int n) const; INLINE const GeometricBoundingVolume *get_local_bound(int n) const; @@ -101,7 +101,7 @@ private: BoundingVolumes _parent_bounds; }; -#include "qpcollisionLevelState.I" +#include "collisionLevelState.I" #endif diff --git a/panda/src/collide/qpcollisionNode.I b/panda/src/collide/collisionNode.I similarity index 85% rename from panda/src/collide/qpcollisionNode.I rename to panda/src/collide/collisionNode.I index 52c0827710..16abb08199 100644 --- a/panda/src/collide/qpcollisionNode.I +++ b/panda/src/collide/collisionNode.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionNode.I +// Filename: collisionNode.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,19 +18,19 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::set_collide_mask +// Function: CollisionNode::set_collide_mask // Access: Public // Description: Simultaneously sets both the "from" and "into" // CollideMask values to the same thing. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionNode:: +INLINE void CollisionNode:: set_collide_mask(CollideMask mask) { set_from_collide_mask(mask); set_into_collide_mask(mask); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::set_from_collide_mask +// Function: CollisionNode::set_from_collide_mask // Access: Public // Description: Sets the "from" CollideMask. In order for a // collision to be detected from this object into @@ -38,13 +38,13 @@ set_collide_mask(CollideMask mask) { // "from" mask and the other object's "into" mask must // be nonzero. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionNode:: +INLINE void CollisionNode:: set_from_collide_mask(CollideMask mask) { _from_collide_mask = mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::set_into_collide_mask +// Function: CollisionNode::set_into_collide_mask // Access: Public // Description: Sets the "into" CollideMask. In order for a // collision to be detected from another object into @@ -52,7 +52,7 @@ set_from_collide_mask(CollideMask mask) { // "from" mask and this object's "into" mask must be // nonzero. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionNode:: +INLINE void CollisionNode:: set_into_collide_mask(CollideMask mask) { _into_collide_mask = mask; @@ -63,7 +63,7 @@ set_into_collide_mask(CollideMask mask) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::get_from_collide_mask +// Function: CollisionNode::get_from_collide_mask // Access: Public // Description: Returns the current "from" CollideMask. In order for // a collision to be detected from this object into @@ -71,13 +71,13 @@ set_into_collide_mask(CollideMask mask) { // "from" mask and the other object's "into" mask must // be nonzero. //////////////////////////////////////////////////////////////////// -INLINE CollideMask qpCollisionNode:: +INLINE CollideMask CollisionNode:: get_from_collide_mask() const { return _from_collide_mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::get_into_collide_mask +// Function: CollisionNode::get_into_collide_mask // Access: Public // Description: Returns the current "into" CollideMask. In order for // a collision to be detected from another object into @@ -85,16 +85,16 @@ get_from_collide_mask() const { // "from" mask and this object's "into" mask must be // nonzero. //////////////////////////////////////////////////////////////////// -INLINE CollideMask qpCollisionNode:: +INLINE CollideMask CollisionNode:: get_into_collide_mask() const { return _into_collide_mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::set_collide_geom +// Function: CollisionNode::set_collide_geom // Access: Public // Description: Sets the state of the "collide geom" flag for this -// qpCollisionNode. Normally, this is false; when this is +// CollisionNode. Normally, this is false; when this is // set true, the CollisionSolids in this node will test // for collisions with actual renderable geometry, in // addition to whatever CollisionSolids may be indicated @@ -105,50 +105,50 @@ get_into_collide_mask() const { // thing; there is no way to collide with only some // GeomNodes, as GeomNodes have no into_collide_mask. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionNode:: +INLINE void CollisionNode:: set_collide_geom(bool flag) { _collide_geom = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::get_collide_geom +// Function: CollisionNode::get_collide_geom // Access: Public // Description: Returns the current state of the collide_geom flag. // See set_collide_geom(). //////////////////////////////////////////////////////////////////// -INLINE bool qpCollisionNode:: +INLINE bool CollisionNode:: get_collide_geom() const { return _collide_geom; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::get_num_solids +// Function: CollisionNode::get_num_solids // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE int qpCollisionNode:: +INLINE int CollisionNode:: get_num_solids() const { return _solids.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::get_solid +// Function: CollisionNode::get_solid // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE CollisionSolid *qpCollisionNode:: +INLINE CollisionSolid *CollisionNode:: get_solid(int n) const { nassertr(n >= 0 && n < get_num_solids(), NULL); return _solids[n]; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::remove_solid +// Function: CollisionNode::remove_solid // Access: Public // Description: Removes the solid with the indicated index. This // will shift all subsequent indices down by one. //////////////////////////////////////////////////////////////////// -INLINE void qpCollisionNode:: +INLINE void CollisionNode:: remove_solid(int n) { nassertv(n >= 0 && n < get_num_solids()); _solids.erase(_solids.begin() + n); @@ -156,13 +156,13 @@ remove_solid(int n) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::add_solid +// Function: CollisionNode::add_solid // Access: Public // Description: Adds the indicated solid to the node. Returns the // index of the new solid within the node's list of // solids. //////////////////////////////////////////////////////////////////// -INLINE int qpCollisionNode:: +INLINE int CollisionNode:: add_solid(CollisionSolid *solid) { _solids.push_back(solid); mark_bound_stale(); diff --git a/panda/src/collide/qpcollisionNode.cxx b/panda/src/collide/collisionNode.cxx similarity index 85% rename from panda/src/collide/qpcollisionNode.cxx rename to panda/src/collide/collisionNode.cxx index 5295768256..f0f35497cb 100644 --- a/panda/src/collide/qpcollisionNode.cxx +++ b/panda/src/collide/collisionNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionNode.cxx +// Filename: collisionNode.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,27 +16,27 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionNode.h" +#include "collisionNode.h" #include "config_collide.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "cullTraverserData.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "datagram.h" #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" -TypeHandle qpCollisionNode::_type_handle; +TypeHandle CollisionNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::Constructor +// Function: CollisionNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionNode:: -qpCollisionNode(const string &name) : +CollisionNode:: +CollisionNode(const string &name) : PandaNode(name), _from_collide_mask(CollideMask::all_on()), _into_collide_mask(CollideMask::all_on()), @@ -47,12 +47,12 @@ qpCollisionNode(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::Copy Constructor +// Function: CollisionNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpCollisionNode:: -qpCollisionNode(const qpCollisionNode ©) : +CollisionNode:: +CollisionNode(const CollisionNode ©) : PandaNode(copy), _from_collide_mask(copy._from_collide_mask), _into_collide_mask(copy._into_collide_mask), @@ -62,47 +62,47 @@ qpCollisionNode(const qpCollisionNode ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::Destructor +// Function: CollisionNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpCollisionNode:: -~qpCollisionNode() { +CollisionNode:: +~CollisionNode() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::make_copy +// Function: CollisionNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpCollisionNode:: +PandaNode *CollisionNode:: make_copy() const { - return new qpCollisionNode(*this); + return new CollisionNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::preserve_name +// Function: CollisionNode::preserve_name // Access: Public, Virtual // Description: Returns true if the node's name has extrinsic meaning // and must be preserved across a flatten operation, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpCollisionNode:: +bool CollisionNode:: preserve_name() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::xform +// Function: CollisionNode::xform // Access: Public, Virtual // Description: Transforms the contents of this node by the indicated // matrix, if it means anything to do so. For most // kinds of nodes, this does nothing. //////////////////////////////////////////////////////////////////// -void qpCollisionNode:: +void CollisionNode:: xform(const LMatrix4f &mat) { nassertv(!mat.is_nan()); @@ -127,7 +127,7 @@ xform(const LMatrix4f &mat) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::combine_with +// Function: CollisionNode::combine_with // Access: Public, Virtual // Description: Collapses this node with the other node, if possible, // and returns a pointer to the combined node, or NULL @@ -141,13 +141,13 @@ xform(const LMatrix4f &mat) { // decide whether to collapse the two nodes and what the // collapsed node should look like. //////////////////////////////////////////////////////////////////// -PandaNode *qpCollisionNode:: +PandaNode *CollisionNode:: combine_with(PandaNode *other) { if (is_exact_type(get_class_type()) && other->is_exact_type(get_class_type())) { - // Two qpCollisionNodes can combine, but only if they have the same + // Two CollisionNodes can combine, but only if they have the same // name, because the name is often meaningful. - qpCollisionNode *cother = DCAST(qpCollisionNode, other); + CollisionNode *cother = DCAST(CollisionNode, other); if (get_name() == cother->get_name()) { const PT(CollisionSolid) *solids_begin = &cother->_solids[0]; const PT(CollisionSolid) *solids_end = solids_begin + cother->_solids.size(); @@ -156,7 +156,7 @@ combine_with(PandaNode *other) { return this; } - // Two qpCollisionNodes with different names can't combine. + // Two CollisionNodes with different names can't combine. return (PandaNode *)NULL; } @@ -164,7 +164,7 @@ combine_with(PandaNode *other) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::has_cull_callback +// Function: CollisionNode::has_cull_callback // Access: Public, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -172,13 +172,13 @@ combine_with(PandaNode *other) { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpCollisionNode:: +bool CollisionNode:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::cull_callback +// Function: CollisionNode::cull_callback // Access: Public, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -196,8 +196,8 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpCollisionNode:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { +bool CollisionNode:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { // Append our collision vizzes to the drawing, even though they're // not actually part of the scene graph. Solids::iterator si; @@ -218,14 +218,14 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::output +// Function: CollisionNode::output // Access: Public, Virtual // Description: Writes a brief description of the node to the // indicated output stream. This is invoked by the << // operator. It may be overridden in derived classes to // include some information relevant to the class. //////////////////////////////////////////////////////////////////// -void qpCollisionNode:: +void CollisionNode:: output(ostream &out) const { PandaNode::output(out); out << " (" << _solids.size() << " solids)"; @@ -233,7 +233,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::recompute_bound +// Function: CollisionNode::recompute_bound // Access: Protected, Virtual // Description: Recomputes the dynamic bounding volume for this // object. This is the bounding volume for the node and @@ -242,7 +242,7 @@ output(ostream &out) const { // function just so we can piggyback on it the // setting the _net_collide_mask bits. //////////////////////////////////////////////////////////////////// -BoundingVolume *qpCollisionNode:: +BoundingVolume *CollisionNode:: recompute_bound() { BoundingVolume *result = PandaNode::recompute_bound(); add_net_collide_mask(get_into_collide_mask()); @@ -250,14 +250,14 @@ recompute_bound() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::recompute_internal_bound +// Function: CollisionNode::recompute_internal_bound // Access: Protected, Virtual // Description: Called when needed to recompute the node's // _internal_bound object. Nodes that contain anything // of substance should redefine this to do the right // thing. //////////////////////////////////////////////////////////////////// -BoundingVolume *qpCollisionNode:: +BoundingVolume *CollisionNode:: recompute_internal_bound() { // First, get ourselves a fresh, empty bounding volume. BoundingVolume *bound = PandaNode::recompute_internal_bound(); @@ -294,23 +294,23 @@ recompute_internal_bound() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::register_with_read_factory +// Function: CollisionNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpCollisionNode. +// CollisionNode. //////////////////////////////////////////////////////////////////// -void qpCollisionNode:: +void CollisionNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::write_datagram +// Function: CollisionNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpCollisionNode:: +void CollisionNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); @@ -326,13 +326,13 @@ write_datagram(BamWriter *manager, Datagram &dg) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::complete_pointers +// Function: CollisionNode::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpCollisionNode:: +int CollisionNode:: complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = PandaNode::complete_pointers(p_list, manager); @@ -345,16 +345,16 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::make_from_bam +// Function: CollisionNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpCollisionNode is encountered -// in the Bam file. It should create the qpCollisionNode +// when a new object of type CollisionNode is encountered +// in the Bam file. It should create the CollisionNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpCollisionNode:: +TypedWritable *CollisionNode:: make_from_bam(const FactoryParams ¶ms) { - qpCollisionNode *node = new qpCollisionNode(""); + CollisionNode *node = new CollisionNode(""); DatagramIterator scan; BamReader *manager; @@ -365,13 +365,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionNode::fillin +// Function: CollisionNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpCollisionNode. +// the new CollisionNode. //////////////////////////////////////////////////////////////////// -void qpCollisionNode:: +void CollisionNode:: fillin(DatagramIterator &scan, BamReader *manager) { PandaNode::fillin(scan, manager); diff --git a/panda/src/collide/qpcollisionNode.h b/panda/src/collide/collisionNode.h similarity index 88% rename from panda/src/collide/qpcollisionNode.h rename to panda/src/collide/collisionNode.h index 58d474b292..cf1ae4cdbf 100644 --- a/panda/src/collide/qpcollisionNode.h +++ b/panda/src/collide/collisionNode.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionNode.h +// Filename: collisionNode.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONNODE_H -#define qpCOLLISIONNODE_H +#ifndef COLLISIONNODE_H +#define COLLISIONNODE_H #include "pandabase.h" @@ -34,22 +34,22 @@ // with, or an animated object twirling around in the // world and running into things. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionNode : public PandaNode { +class EXPCL_PANDA CollisionNode : public PandaNode { PUBLISHED: - qpCollisionNode(const string &name); + CollisionNode(const string &name); protected: - qpCollisionNode(const qpCollisionNode ©); + CollisionNode(const CollisionNode ©); public: - virtual ~qpCollisionNode(); + virtual ~CollisionNode(); virtual PandaNode *make_copy() const; virtual bool preserve_name() const; virtual void xform(const LMatrix4f &mat); virtual PandaNode *combine_with(PandaNode *other); virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual void output(ostream &out) const; @@ -98,7 +98,7 @@ public: } static void init_type(void) { PandaNode::init_type(); - register_type(_type_handle, "qpCollisionNode", + register_type(_type_handle, "CollisionNode", PandaNode::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -110,6 +110,6 @@ private: static TypeHandle _type_handle; }; -#include "qpcollisionNode.I" +#include "collisionNode.I" #endif diff --git a/panda/src/collide/collisionPlane.cxx b/panda/src/collide/collisionPlane.cxx index ccd320f525..40aa581321 100644 --- a/panda/src/collide/collisionPlane.cxx +++ b/panda/src/collide/collisionPlane.cxx @@ -18,14 +18,14 @@ #include "collisionPlane.h" -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" #include "collisionSphere.h" #include "collisionRay.h" #include "config_collide.h" #include "pointerToArray.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geom.h" #include "datagram.h" #include "datagramIterator.h" @@ -52,7 +52,7 @@ make_copy() { // Description: //////////////////////////////////////////////////////////////////// int CollisionPlane:: -test_intersection(qpCollisionHandler *, const qpCollisionEntry &, +test_intersection(CollisionHandler *, const CollisionEntry &, const CollisionSolid *) const { // Planes cannot currently be intersected from, only into. Do not // add a CollisionPlane to a CollisionTraverser. @@ -118,8 +118,8 @@ recompute_bound() { // Description: //////////////////////////////////////////////////////////////////// int CollisionPlane:: -test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const { const CollisionSphere *sphere; DCAST_INTO_R(sphere, entry.get_from(), 0); @@ -139,7 +139,7 @@ test_intersection_from_sphere(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); LVector3f into_normal = get_normal() * entry.get_inv_wrt_space(); float into_depth = from_radius - dist; @@ -157,8 +157,8 @@ test_intersection_from_sphere(qpCollisionHandler *record, // Description: //////////////////////////////////////////////////////////////////// int CollisionPlane:: -test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const { const CollisionRay *ray; DCAST_INTO_R(ray, entry.get_from(), 0); @@ -181,7 +181,7 @@ test_intersection_from_ray(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); LPoint3f into_intersection_point = from_origin + t * from_direction; new_entry->set_into_intersection_point(into_intersection_point); diff --git a/panda/src/collide/collisionPlane.h b/panda/src/collide/collisionPlane.h index 3b221cf5e4..ffa3fc0419 100644 --- a/panda/src/collide/collisionPlane.h +++ b/panda/src/collide/collisionPlane.h @@ -42,8 +42,8 @@ public: virtual CollisionSolid *make_copy(); virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); @@ -63,11 +63,11 @@ protected: protected: virtual int - test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const; virtual void fill_viz_geom(); diff --git a/panda/src/collide/collisionPolygon.cxx b/panda/src/collide/collisionPolygon.cxx index f38c927aa2..787aecfe82 100644 --- a/panda/src/collide/collisionPolygon.cxx +++ b/panda/src/collide/collisionPolygon.cxx @@ -18,8 +18,8 @@ #include "collisionPolygon.h" -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" #include "collisionSphere.h" #include "collisionRay.h" #include "collisionSegment.h" @@ -27,7 +27,7 @@ #include "boundingSphere.h" #include "pointerToArray.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geom.h" #include "datagram.h" #include "datagramIterator.h" @@ -126,7 +126,7 @@ verify_points(const LPoint3f *begin, const LPoint3f *end) { // Description: //////////////////////////////////////////////////////////////////// int CollisionPolygon:: -test_intersection(qpCollisionHandler *, const qpCollisionEntry &, +test_intersection(CollisionHandler *, const CollisionEntry &, const CollisionSolid *into) const { // Polygons cannot currently be intersected from, only into. Do not // add a CollisionPolygon to a CollisionTraverser. @@ -231,8 +231,8 @@ recompute_bound() { // Description: //////////////////////////////////////////////////////////////////// int CollisionPolygon:: -test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const { if (_points.size() < 3) { return 0; } @@ -321,7 +321,7 @@ test_intersection_from_sphere(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); LVector3f into_normal = get_normal() * entry.get_inv_wrt_space(); float into_depth = from_radius - dist; @@ -339,8 +339,8 @@ test_intersection_from_sphere(qpCollisionHandler *record, // Description: //////////////////////////////////////////////////////////////////// int CollisionPolygon:: -test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const { if (_points.size() < 3) { return 0; } @@ -373,7 +373,7 @@ test_intersection_from_ray(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); new_entry->set_into_intersection_point(plane_point); @@ -387,8 +387,8 @@ test_intersection_from_ray(qpCollisionHandler *record, // Description: //////////////////////////////////////////////////////////////////// int CollisionPolygon:: -test_intersection_from_segment(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_segment(CollisionHandler *record, + const CollisionEntry &entry) const { if (_points.size() < 3) { return 0; } @@ -423,7 +423,7 @@ test_intersection_from_segment(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); new_entry->set_into_intersection_point(plane_point); diff --git a/panda/src/collide/collisionPolygon.h b/panda/src/collide/collisionPolygon.h index f9c3baa5d3..8cba5e6ba5 100644 --- a/panda/src/collide/collisionPolygon.h +++ b/panda/src/collide/collisionPolygon.h @@ -50,8 +50,8 @@ public: virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); @@ -65,14 +65,14 @@ protected: protected: virtual int - test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_segment(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_segment(CollisionHandler *record, + const CollisionEntry &entry) const; virtual void fill_viz_geom(); diff --git a/panda/src/collide/collisionRay.I b/panda/src/collide/collisionRay.I index 41032cc610..deb0cf2297 100644 --- a/panda/src/collide/collisionRay.I +++ b/panda/src/collide/collisionRay.I @@ -137,13 +137,13 @@ get_direction() const { //////////////////////////////////////////////////////////////////// // Function: CollisionRay::set_from_lens // Access: Public -// Description: Accepts a qpLensNode and a 2-d point in the range +// Description: Accepts a LensNode and a 2-d point in the range // [-1,1]. Sets the CollisionRay so that it begins at -// the qpLensNode's near plane and extends to +// the LensNode's near plane and extends to // infinity, making it suitable for picking objects from // the screen given a camera and a mouse location. //////////////////////////////////////////////////////////////////// INLINE bool CollisionRay:: -set_from_lens(qpLensNode *camera, float px, float py) { +set_from_lens(LensNode *camera, float px, float py) { return set_from_lens(camera, LPoint2f(px, py)); } diff --git a/panda/src/collide/collisionRay.cxx b/panda/src/collide/collisionRay.cxx index d382c639fe..acaa2083c9 100644 --- a/panda/src/collide/collisionRay.cxx +++ b/panda/src/collide/collisionRay.cxx @@ -17,14 +17,14 @@ //////////////////////////////////////////////////////////////////// #include "collisionRay.h" -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" #include "config_collide.h" #include "geom.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geomLinestrip.h" #include "boundingLine.h" -#include "qplensNode.h" +#include "lensNode.h" #include "lens.h" #include "datagram.h" #include "datagramIterator.h" @@ -50,7 +50,7 @@ make_copy() { // Description: //////////////////////////////////////////////////////////////////// int CollisionRay:: -test_intersection(qpCollisionHandler *record, const qpCollisionEntry &entry, +test_intersection(CollisionHandler *record, const CollisionEntry &entry, const CollisionSolid *into) const { return into->test_intersection_from_ray(record, entry); } @@ -94,9 +94,9 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// // Function: CollisionRay::set_from_lens // Access: Public -// Description: Accepts a qpLensNode and a 2-d point in the range +// Description: Accepts a LensNode and a 2-d point in the range // [-1,1]. Sets the CollisionRay so that it begins at -// the qpLensNode's near plane and extends to +// the LensNode's near plane and extends to // infinity, making it suitable for picking objects from // the screen given a camera and a mouse location. // @@ -104,7 +104,7 @@ output(ostream &out) const { // otherwise. //////////////////////////////////////////////////////////////////// bool CollisionRay:: -set_from_lens(qpLensNode *camera, const LPoint2f &point) { +set_from_lens(LensNode *camera, const LPoint2f &point) { Lens *lens = camera->get_lens(); bool success = true; diff --git a/panda/src/collide/collisionRay.h b/panda/src/collide/collisionRay.h index 7e22374476..b7dc183cee 100644 --- a/panda/src/collide/collisionRay.h +++ b/panda/src/collide/collisionRay.h @@ -23,7 +23,7 @@ #include "collisionSolid.h" -class qpLensNode; +class LensNode; /////////////////////////////////////////////////////////////////// // Class : CollisionRay @@ -45,8 +45,8 @@ public: virtual CollisionSolid *make_copy(); virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); @@ -63,8 +63,8 @@ PUBLISHED: INLINE void set_direction(float x, float y, float z); INLINE const LVector3f &get_direction() const; - bool set_from_lens(qpLensNode *camera, const LPoint2f &point); - INLINE bool set_from_lens(qpLensNode *camera, float px, float py); + bool set_from_lens(LensNode *camera, const LPoint2f &point); + INLINE bool set_from_lens(LensNode *camera, float px, float py); protected: virtual BoundingVolume *recompute_bound(); diff --git a/panda/src/collide/collisionSegment.I b/panda/src/collide/collisionSegment.I index 6320e4100f..625b9ea2ca 100644 --- a/panda/src/collide/collisionSegment.I +++ b/panda/src/collide/collisionSegment.I @@ -140,13 +140,13 @@ get_point_b() const { //////////////////////////////////////////////////////////////////// // Function: CollisionSegment::set_from_lens // Access: Public -// Description: Accepts a qpLensNode and a 2-d point in the range +// Description: Accepts a LensNode and a 2-d point in the range // [-1,1]. Sets the CollisionSegment so that it begins at -// the qpLensNode's near plane and extends to the +// the LensNode's near plane and extends to the // far plane, making it suitable for picking objects // from the screen given a camera and a mouse location. //////////////////////////////////////////////////////////////////// INLINE bool CollisionSegment:: -set_from_lens(qpLensNode *camera, float px, float py) { +set_from_lens(LensNode *camera, float px, float py) { return set_from_lens(camera, LPoint2f(px, py)); } diff --git a/panda/src/collide/collisionSegment.cxx b/panda/src/collide/collisionSegment.cxx index cd493b2bab..d5ef3d3068 100644 --- a/panda/src/collide/collisionSegment.cxx +++ b/panda/src/collide/collisionSegment.cxx @@ -18,13 +18,13 @@ #include "collisionSegment.h" -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" #include "config_collide.h" #include "geom.h" -#include "qplensNode.h" -#include "qpgeomNode.h" +#include "lensNode.h" +#include "geomNode.h" #include "lens.h" #include "geomLine.h" #include "geometricBoundingVolume.h" @@ -52,7 +52,7 @@ make_copy() { // Description: //////////////////////////////////////////////////////////////////// int CollisionSegment:: -test_intersection(qpCollisionHandler *record, const qpCollisionEntry &entry, +test_intersection(CollisionHandler *record, const CollisionEntry &entry, const CollisionSolid *into) const { return into->test_intersection_from_segment(record, entry); } @@ -96,9 +96,9 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// // Function: CollisionSegment::set_from_lens // Access: Public -// Description: Accepts a qpLensNode and a 2-d point in the range +// Description: Accepts a LensNode and a 2-d point in the range // [-1,1]. Sets the CollisionSegment so that it begins at -// the qpLensNode's near plane and extends to the +// the LensNode's near plane and extends to the // far plane, making it suitable for picking objects // from the screen given a camera and a mouse location. // @@ -106,7 +106,7 @@ output(ostream &out) const { // otherwise. //////////////////////////////////////////////////////////////////// bool CollisionSegment:: -set_from_lens(qpLensNode *camera, const LPoint2f &point) { +set_from_lens(LensNode *camera, const LPoint2f &point) { Lens *proj = camera->get_lens(); bool success = true; diff --git a/panda/src/collide/collisionSegment.h b/panda/src/collide/collisionSegment.h index 39dc9586b3..5e10d1d1bb 100644 --- a/panda/src/collide/collisionSegment.h +++ b/panda/src/collide/collisionSegment.h @@ -23,7 +23,7 @@ #include "collisionSolid.h" -class qpLensNode; +class LensNode; /////////////////////////////////////////////////////////////////// // Class : CollisionSegment @@ -48,8 +48,8 @@ public: virtual CollisionSolid *make_copy(); virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); @@ -66,8 +66,8 @@ PUBLISHED: INLINE void set_point_b(float x, float y, float z); INLINE const LPoint3f &get_point_b() const; - bool set_from_lens(qpLensNode *camera, const LPoint2f &point); - INLINE bool set_from_lens(qpLensNode *camera, float px, float py); + bool set_from_lens(LensNode *camera, const LPoint2f &point); + INLINE bool set_from_lens(LensNode *camera, float px, float py); protected: virtual BoundingVolume *recompute_bound(); diff --git a/panda/src/collide/collisionSolid.cxx b/panda/src/collide/collisionSolid.cxx index df7f8589fa..8084702c1c 100644 --- a/panda/src/collide/collisionSolid.cxx +++ b/panda/src/collide/collisionSolid.cxx @@ -32,7 +32,7 @@ #include "colorAttrib.h" #include "renderModeAttrib.h" #include "transparencyAttrib.h" -#include "qpgeomNode.h" +#include "geomNode.h" TypeHandle CollisionSolid::_type_handle; @@ -77,11 +77,11 @@ CollisionSolid:: // traversal to render the CollisionNodes that have been // made visible. //////////////////////////////////////////////////////////////////// -qpGeomNode *CollisionSolid:: +GeomNode *CollisionSolid:: get_viz() { if (_viz_geom_stale) { - if (_viz_geom == (qpGeomNode *)NULL) { - _viz_geom = new qpGeomNode("viz"); + if (_viz_geom == (GeomNode *)NULL) { + _viz_geom = new GeomNode("viz"); } else { _viz_geom->remove_all_geoms(); } @@ -117,8 +117,8 @@ write(ostream &out, int indent_level) const { // Description: //////////////////////////////////////////////////////////////////// int CollisionSolid:: -test_intersection_from_sphere(qpCollisionHandler *, - const qpCollisionEntry &) const { +test_intersection_from_sphere(CollisionHandler *, + const CollisionEntry &) const { report_undefined_intersection_test(CollisionSphere::get_class_type(), get_type()); return 0; @@ -130,8 +130,8 @@ test_intersection_from_sphere(qpCollisionHandler *, // Description: //////////////////////////////////////////////////////////////////// int CollisionSolid:: -test_intersection_from_ray(qpCollisionHandler *, - const qpCollisionEntry &) const { +test_intersection_from_ray(CollisionHandler *, + const CollisionEntry &) const { report_undefined_intersection_test(CollisionRay::get_class_type(), get_type()); return 0; @@ -143,8 +143,8 @@ test_intersection_from_ray(qpCollisionHandler *, // Description: //////////////////////////////////////////////////////////////////// int CollisionSolid:: -test_intersection_from_segment(qpCollisionHandler *, - const qpCollisionEntry &) const { +test_intersection_from_segment(CollisionHandler *, + const CollisionEntry &) const { report_undefined_intersection_test(CollisionSegment::get_class_type(), get_type()); return 0; diff --git a/panda/src/collide/collisionSolid.h b/panda/src/collide/collisionSolid.h index 7be22f53ef..f1e600791b 100644 --- a/panda/src/collide/collisionSolid.h +++ b/panda/src/collide/collisionSolid.h @@ -26,13 +26,13 @@ #include "luse.h" #include "pointerTo.h" #include "renderState.h" -#include "qpgeomNode.h" +#include "geomNode.h" -class qpCollisionHandler; -class qpCollisionEntry; +class CollisionHandler; +class CollisionEntry; class CollisionSphere; -class qpGeomNode; -class qpCollisionNode; +class GeomNode; +class CollisionNode; /////////////////////////////////////////////////////////////////// // Class : CollisionSolid @@ -63,13 +63,13 @@ PUBLISHED: public: virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const=0; virtual void xform(const LMatrix4f &mat)=0; - qpGeomNode *get_viz(); + GeomNode *get_viz(); PUBLISHED: virtual void output(ostream &out) const; @@ -77,14 +77,14 @@ PUBLISHED: protected: virtual int - test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_segment(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_segment(CollisionHandler *record, + const CollisionEntry &entry) const; static void report_undefined_intersection_test(TypeHandle from_type, @@ -97,7 +97,7 @@ protected: CPT(RenderState) get_wireframe_viz_state(); CPT(RenderState) get_other_viz_state(); - PT(qpGeomNode) _viz_geom; + PT(GeomNode) _viz_geom; bool _viz_geom_stale; bool _tangible; diff --git a/panda/src/collide/collisionSphere.cxx b/panda/src/collide/collisionSphere.cxx index eccb08dd2c..1dcecfecf7 100644 --- a/panda/src/collide/collisionSphere.cxx +++ b/panda/src/collide/collisionSphere.cxx @@ -20,8 +20,8 @@ #include "collisionSphere.h" #include "collisionRay.h" #include "collisionSegment.h" -#include "qpcollisionHandler.h" -#include "qpcollisionEntry.h" +#include "collisionHandler.h" +#include "collisionEntry.h" #include "config_collide.h" #include "boundingSphere.h" @@ -50,7 +50,7 @@ make_copy() { // Description: //////////////////////////////////////////////////////////////////// int CollisionSphere:: -test_intersection(qpCollisionHandler *record, const qpCollisionEntry &entry, +test_intersection(CollisionHandler *record, const CollisionEntry &entry, const CollisionSolid *into) const { return into->test_intersection_from_sphere(record, entry); } @@ -118,8 +118,8 @@ recompute_bound() { // Description: //////////////////////////////////////////////////////////////////// int CollisionSphere:: -test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const { const CollisionSphere *sphere; DCAST_INTO_R(sphere, entry.get_from(), 0); @@ -143,7 +143,7 @@ test_intersection_from_sphere(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); float dist = sqrtf(dist2); LVector3f into_normal = normalize(vec); @@ -164,8 +164,8 @@ test_intersection_from_sphere(qpCollisionHandler *record, // Description: //////////////////////////////////////////////////////////////////// int CollisionSphere:: -test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const { const CollisionRay *ray; DCAST_INTO_R(ray, entry.get_from(), 0); @@ -188,7 +188,7 @@ test_intersection_from_ray(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); LPoint3f into_intersection_point; if (t1 < 0.0) { @@ -208,8 +208,8 @@ test_intersection_from_ray(qpCollisionHandler *record, // Description: //////////////////////////////////////////////////////////////////// int CollisionSphere:: -test_intersection_from_segment(qpCollisionHandler *record, - const qpCollisionEntry &entry) const { +test_intersection_from_segment(CollisionHandler *record, + const CollisionEntry &entry) const { const CollisionSegment *segment; DCAST_INTO_R(segment, entry.get_from(), 0); @@ -234,7 +234,7 @@ test_intersection_from_segment(qpCollisionHandler *record, << "intersection detected from " << *entry.get_from_node() << " into " << entry.get_into_node_path() << "\n"; } - PT(qpCollisionEntry) new_entry = new qpCollisionEntry(entry); + PT(CollisionEntry) new_entry = new CollisionEntry(entry); LPoint3f into_intersection_point; if (t1 < 0.0) { diff --git a/panda/src/collide/collisionSphere.h b/panda/src/collide/collisionSphere.h index 7f864f4c1e..d6c56abfa1 100644 --- a/panda/src/collide/collisionSphere.h +++ b/panda/src/collide/collisionSphere.h @@ -37,8 +37,8 @@ public: virtual CollisionSolid *make_copy(); virtual int - test_intersection(qpCollisionHandler *record, - const qpCollisionEntry &entry, + test_intersection(CollisionHandler *record, + const CollisionEntry &entry, const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); @@ -60,14 +60,14 @@ protected: protected: virtual int - test_intersection_from_sphere(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_sphere(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_ray(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_ray(CollisionHandler *record, + const CollisionEntry &entry) const; virtual int - test_intersection_from_segment(qpCollisionHandler *record, - const qpCollisionEntry &entry) const; + test_intersection_from_segment(CollisionHandler *record, + const CollisionEntry &entry) const; virtual void fill_viz_geom(); diff --git a/panda/src/collide/qpcollisionTraverser.I b/panda/src/collide/collisionTraverser.I similarity index 94% rename from panda/src/collide/qpcollisionTraverser.I rename to panda/src/collide/collisionTraverser.I index 498394c552..d63b7bab35 100644 --- a/panda/src/collide/qpcollisionTraverser.I +++ b/panda/src/collide/collisionTraverser.I @@ -1,4 +1,4 @@ -// Filename: qpcollisionTraverser.I +// Filename: collisionTraverser.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// diff --git a/panda/src/collide/qpcollisionTraverser.cxx b/panda/src/collide/collisionTraverser.cxx similarity index 81% rename from panda/src/collide/qpcollisionTraverser.cxx rename to panda/src/collide/collisionTraverser.cxx index ba288bc9ef..a1a581356b 100644 --- a/panda/src/collide/qpcollisionTraverser.cxx +++ b/panda/src/collide/collisionTraverser.cxx @@ -1,4 +1,4 @@ -// Filename: qpcollisionTraverser.cxx +// Filename: collisionTraverser.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,67 +16,67 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcollisionTraverser.h" -#include "qpcollisionNode.h" -#include "qpcollisionEntry.h" +#include "collisionTraverser.h" +#include "collisionNode.h" +#include "collisionEntry.h" #include "collisionPolygon.h" #include "config_collide.h" #include "transformState.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geom.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "pStatTimer.h" #include "indent.h" #ifndef CPPPARSER -PStatCollector qpCollisionTraverser::_collisions_pcollector("App:Collisions"); +PStatCollector CollisionTraverser::_collisions_pcollector("App:Collisions"); #endif //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::Constructor +// Function: CollisionTraverser::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionTraverser:: -qpCollisionTraverser() { +CollisionTraverser:: +CollisionTraverser() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::Destructor +// Function: CollisionTraverser::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCollisionTraverser:: -~qpCollisionTraverser() { +CollisionTraverser:: +~CollisionTraverser() { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::add_collider +// Function: CollisionTraverser::add_collider // Access: Public -// Description: Adds a new qpCollisionNode, representing an object that +// Description: Adds a new CollisionNode, representing an object that // will be tested for collisions into other objects, // along with the handler that will serve each detected -// collision. Each qpCollisionNode may be served by only +// collision. Each CollisionNode may be served by only // one handler at a time, but a given handler may serve -// many qpCollisionNodes. +// many CollisionNodes. // // The handler that serves a particular node may be // changed from time to time by calling add_collider() // again on the same node. //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -add_collider(qpCollisionNode *node, qpCollisionHandler *handler) { +void CollisionTraverser:: +add_collider(CollisionNode *node, CollisionHandler *handler) { nassertv(_ordered_colliders.size() == _colliders.size()); - nassertv(node != (qpCollisionNode *)NULL); - nassertv(handler != (qpCollisionHandler *)NULL); + nassertv(node != (CollisionNode *)NULL); + nassertv(handler != (CollisionHandler *)NULL); Colliders::iterator ci = _colliders.find(node); if (ci != _colliders.end()) { // We already knew about this collider. if ((*ci).second != handler) { // Change the handler. - PT(qpCollisionHandler) old_handler = (*ci).second; + PT(CollisionHandler) old_handler = (*ci).second; (*ci).second = handler; // Now update our own reference counts within our handler set. @@ -113,16 +113,16 @@ add_collider(qpCollisionNode *node, qpCollisionHandler *handler) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::remove_collider +// Function: CollisionTraverser::remove_collider // Access: Public // Description: Removes the collider (and its associated handler) -// from the set of qpCollisionNodes that will be tested +// from the set of CollisionNodes that will be tested // each frame for collisions into other objects. // Returns true if the definition was found and removed, // false if it wasn't present to begin with. //////////////////////////////////////////////////////////////////// -bool qpCollisionTraverser:: -remove_collider(qpCollisionNode *node) { +bool CollisionTraverser:: +remove_collider(CollisionNode *node) { nassertr(_ordered_colliders.size() == _colliders.size(), false); Colliders::iterator ci = _colliders.find(node); @@ -131,7 +131,7 @@ remove_collider(qpCollisionNode *node) { return false; } - qpCollisionHandler *handler = (*ci).second; + CollisionHandler *handler = (*ci).second; // Update the set of handlers. Handlers::iterator hi = _handlers.find(handler); @@ -154,37 +154,37 @@ remove_collider(qpCollisionNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::has_collider +// Function: CollisionTraverser::has_collider // Access: Public // Description: Returns true if the indicated node is current in the // set of nodes that will be tested each frame for // collisions into other objects. //////////////////////////////////////////////////////////////////// -bool qpCollisionTraverser:: -has_collider(qpCollisionNode *node) const { +bool CollisionTraverser:: +has_collider(CollisionNode *node) const { Colliders::const_iterator ci = _colliders.find(node); return (ci != _colliders.end()); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::get_num_colliders +// Function: CollisionTraverser::get_num_colliders // Access: Public -// Description: Returns the number of qpCollisionNodes that have been +// Description: Returns the number of CollisionNodes that have been // added to the traverser via add_collider(). //////////////////////////////////////////////////////////////////// -int qpCollisionTraverser:: +int CollisionTraverser:: get_num_colliders() const { nassertr(_ordered_colliders.size() == _colliders.size(), 0); return _ordered_colliders.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::get_collider +// Function: CollisionTraverser::get_collider // Access: Public -// Description: Returns the nth qpCollisionNode that has been +// Description: Returns the nth CollisionNode that has been // added to the traverser via add_collider(). //////////////////////////////////////////////////////////////////// -qpCollisionNode *qpCollisionTraverser:: +CollisionNode *CollisionTraverser:: get_collider(int n) const { nassertr(_ordered_colliders.size() == _colliders.size(), NULL); nassertr(n >= 0 && n < (int)_ordered_colliders.size(), NULL); @@ -192,14 +192,14 @@ get_collider(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::get_handler +// Function: CollisionTraverser::get_handler // Access: Public // Description: Returns the handler that is currently assigned to // serve the indicated collision node, or NULL if the // node is not on the traverser's set of active nodes. //////////////////////////////////////////////////////////////////// -qpCollisionHandler *qpCollisionTraverser:: -get_handler(qpCollisionNode *node) const { +CollisionHandler *CollisionTraverser:: +get_handler(CollisionNode *node) const { Colliders::const_iterator ci = _colliders.find(node); if (ci != _colliders.end()) { return (*ci).second; @@ -208,12 +208,12 @@ get_handler(qpCollisionNode *node) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::clear_colliders +// Function: CollisionTraverser::clear_colliders // Access: Public // Description: Completely empties the set of collision nodes and // their associated handlers. //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: +void CollisionTraverser:: clear_colliders() { _colliders.clear(); _ordered_colliders.clear(); @@ -221,15 +221,15 @@ clear_colliders() { //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::traverse +// Function: CollisionTraverser::traverse // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -traverse(const qpNodePath &root) { +void CollisionTraverser:: +traverse(const NodePath &root) { PStatTimer timer(_collisions_pcollector); - qpCollisionLevelState level_state(root); + CollisionLevelState level_state(root); prepare_colliders(level_state); Handlers::iterator hi; @@ -254,32 +254,32 @@ traverse(const qpNodePath &root) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::output +// Function: CollisionTraverser::output // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: +void CollisionTraverser:: output(ostream &out) const { - out << "qpCollisionTraverser, " << _colliders.size() + out << "CollisionTraverser, " << _colliders.size() << " colliders and " << _handlers.size() << " handlers.\n"; } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::write +// Function: CollisionTraverser::write // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: +void CollisionTraverser:: write(ostream &out, int indent_level) const { indent(out, indent_level) - << "qpCollisionTraverser, " << _colliders.size() + << "CollisionTraverser, " << _colliders.size() << " colliders and " << _handlers.size() << " handlers:\n"; Colliders::const_iterator ci; for (ci = _colliders.begin(); ci != _colliders.end(); ++ci) { - qpCollisionNode *cnode = (*ci).first; - qpCollisionHandler *handler = (*ci).second; - nassertv(cnode != (qpCollisionNode *)NULL); - nassertv(handler != (qpCollisionHandler *)NULL); + CollisionNode *cnode = (*ci).first; + CollisionHandler *handler = (*ci).second; + nassertv(cnode != (CollisionNode *)NULL); + nassertv(handler != (CollisionHandler *)NULL); indent(out, indent_level + 2) << *cnode << " handled by " << handler->get_type() << "\n"; @@ -292,23 +292,23 @@ write(ostream &out, int indent_level) const { //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::prepare_colliders +// Function: CollisionTraverser::prepare_colliders // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -prepare_colliders(qpCollisionLevelState &level_state) { +void CollisionTraverser:: +prepare_colliders(CollisionLevelState &level_state) { level_state.clear(); level_state.reserve(_colliders.size()); int i = 0; while (i < (int)_ordered_colliders.size()) { - qpCollisionNode *cnode = _ordered_colliders[i]; + CollisionNode *cnode = _ordered_colliders[i]; - qpCollisionLevelState::ColliderDef def; + CollisionLevelState::ColliderDef def; def._node = cnode; - qpNodePath root; - qpNodePath cnode_path(cnode); + NodePath root; + NodePath cnode_path(cnode); def._space = cnode_path.get_mat(root); def._inv_space = root.get_mat(cnode_path); @@ -335,22 +335,22 @@ prepare_colliders(qpCollisionLevelState &level_state) { } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::r_traverse +// Function: CollisionTraverser::r_traverse // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -r_traverse(qpCollisionLevelState &level_state) { +void CollisionTraverser:: +r_traverse(CollisionLevelState &level_state) { if (!level_state.any_in_bounds()) { return; } level_state.apply_transform(); PandaNode *node = level_state.node(); - if (node->is_exact_type(qpCollisionNode::get_class_type())) { + if (node->is_exact_type(CollisionNode::get_class_type())) { level_state.reached_collision_node(); - qpCollisionNode *cnode; + CollisionNode *cnode; DCAST_INTO_V(cnode, node); const BoundingVolume &node_bv = cnode->get_bound(); const GeometricBoundingVolume *node_gbv = NULL; @@ -358,10 +358,10 @@ r_traverse(qpCollisionLevelState &level_state) { DCAST_INTO_V(node_gbv, &node_bv); } - qpCollisionEntry entry; + CollisionEntry entry; entry._into_node = cnode; entry._into_node_path = level_state.get_node_path(); - entry._into_space = entry._into_node_path.get_mat(qpNodePath()); + entry._into_space = entry._into_node_path.get_mat(NodePath()); int num_colliders = level_state.get_num_colliders(); for (int c = 0; c < num_colliders; c++) { @@ -373,7 +373,7 @@ r_traverse(qpCollisionLevelState &level_state) { entry._from = level_state.get_collider(c); entry._from_space = level_state.get_space(c); - qpNodePath root; + NodePath root; const LMatrix4f &into_space_inv = root.get_mat(entry._into_node_path); entry._wrt_space = entry._from_space * into_space_inv; @@ -396,7 +396,7 @@ r_traverse(qpCollisionLevelState &level_state) { } #endif - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); const BoundingVolume &node_bv = gnode->get_bound(); const GeometricBoundingVolume *node_gbv = NULL; @@ -404,10 +404,10 @@ r_traverse(qpCollisionLevelState &level_state) { DCAST_INTO_V(node_gbv, &node_bv); } - qpCollisionEntry entry; + CollisionEntry entry; entry._into_node = gnode; entry._into_node_path = level_state.get_node_path(); - entry._into_space = entry._into_node_path.get_mat(qpNodePath()); + entry._into_space = entry._into_node_path.get_mat(NodePath()); int num_colliders = level_state.get_num_colliders(); for (int c = 0; c < num_colliders; c++) { @@ -417,7 +417,7 @@ r_traverse(qpCollisionLevelState &level_state) { entry._from = level_state.get_collider(c); entry._from_space = level_state.get_space(c); - qpNodePath root; + NodePath root; const LMatrix4f &into_space_inv = root.get_mat(entry._into_node_path); entry._wrt_space = entry._from_space * into_space_inv; @@ -434,18 +434,18 @@ r_traverse(qpCollisionLevelState &level_state) { int num_children = node->get_num_children(); for (int i = 0; i < num_children; i++) { - qpCollisionLevelState next_state(level_state, node->get_child(i)); + CollisionLevelState next_state(level_state, node->get_child(i)); r_traverse(next_state); } } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::compare_collider_to_node +// Function: CollisionTraverser::compare_collider_to_node // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -compare_collider_to_node(qpCollisionEntry &entry, +void CollisionTraverser:: +compare_collider_to_node(CollisionEntry &entry, const GeometricBoundingVolume *from_parent_gbv, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *into_node_gbv) { @@ -456,7 +456,7 @@ compare_collider_to_node(qpCollisionEntry &entry, } if (within_node_bounds) { - qpCollisionNode *cnode; + CollisionNode *cnode; DCAST_INTO_V(cnode, entry._into_node); int num_solids = cnode->get_num_solids(); for (int s = 0; s < num_solids; s++) { @@ -481,12 +481,12 @@ compare_collider_to_node(qpCollisionEntry &entry, } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::compare_collider_to_geom_node +// Function: CollisionTraverser::compare_collider_to_geom_node // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -compare_collider_to_geom_node(qpCollisionEntry &entry, +void CollisionTraverser:: +compare_collider_to_geom_node(CollisionEntry &entry, const GeometricBoundingVolume *from_parent_gbv, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *into_node_gbv) { @@ -497,7 +497,7 @@ compare_collider_to_geom_node(qpCollisionEntry &entry, } if (within_node_bounds) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, entry._into_node); int num_geoms = gnode->get_num_geoms(); for (int s = 0; s < num_geoms; s++) { @@ -523,12 +523,12 @@ compare_collider_to_geom_node(qpCollisionEntry &entry, } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::compare_collider_to_solid +// Function: CollisionTraverser::compare_collider_to_solid // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -compare_collider_to_solid(qpCollisionEntry &entry, +void CollisionTraverser:: +compare_collider_to_solid(CollisionEntry &entry, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *solid_gbv) { bool within_solid_bounds = true; @@ -545,12 +545,12 @@ compare_collider_to_solid(qpCollisionEntry &entry, } //////////////////////////////////////////////////////////////////// -// Function: qpCollisionTraverser::compare_collider_to_geom +// Function: CollisionTraverser::compare_collider_to_geom // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCollisionTraverser:: -compare_collider_to_geom(qpCollisionEntry &entry, Geom *geom, +void CollisionTraverser:: +compare_collider_to_geom(CollisionEntry &entry, Geom *geom, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *geom_gbv) { bool within_geom_bounds = true; diff --git a/panda/src/collide/qpcollisionTraverser.h b/panda/src/collide/collisionTraverser.h similarity index 60% rename from panda/src/collide/qpcollisionTraverser.h rename to panda/src/collide/collisionTraverser.h index 1800d97856..14d35a17c3 100644 --- a/panda/src/collide/qpcollisionTraverser.h +++ b/panda/src/collide/collisionTraverser.h @@ -1,4 +1,4 @@ -// Filename: qpcollisionTraverser.h +// Filename: collisionTraverser.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,88 +16,88 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCOLLISIONTRAVERSER_H -#define qpCOLLISIONTRAVERSER_H +#ifndef COLLISIONTRAVERSER_H +#define COLLISIONTRAVERSER_H #include "pandabase.h" -#include "qpcollisionHandler.h" -#include "qpcollisionLevelState.h" +#include "collisionHandler.h" +#include "collisionLevelState.h" #include "pointerTo.h" #include "pStatCollector.h" #include "pset.h" -class qpCollisionNode; +class CollisionNode; class Geom; -class qpNodePath; -class qpCollisionEntry; +class NodePath; +class CollisionEntry; //////////////////////////////////////////////////////////////////// -// Class : qpCollisionTraverser +// Class : CollisionTraverser // Description : //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCollisionTraverser { +class EXPCL_PANDA CollisionTraverser { PUBLISHED: - qpCollisionTraverser(); - ~qpCollisionTraverser(); + CollisionTraverser(); + ~CollisionTraverser(); - void add_collider(qpCollisionNode *node, qpCollisionHandler *handler); - bool remove_collider(qpCollisionNode *node); - bool has_collider(qpCollisionNode *node) const; + void add_collider(CollisionNode *node, CollisionHandler *handler); + bool remove_collider(CollisionNode *node); + bool has_collider(CollisionNode *node) const; int get_num_colliders() const; - qpCollisionNode *get_collider(int n) const; - qpCollisionHandler *get_handler(qpCollisionNode *node) const; + CollisionNode *get_collider(int n) const; + CollisionHandler *get_handler(CollisionNode *node) const; void clear_colliders(); - void traverse(const qpNodePath &root); + void traverse(const NodePath &root); void output(ostream &out) const; void write(ostream &out, int indent_level) const; private: - void prepare_colliders(qpCollisionLevelState &state); + void prepare_colliders(CollisionLevelState &state); - void r_traverse(qpCollisionLevelState &level_state); + void r_traverse(CollisionLevelState &level_state); - void compare_collider_to_node(qpCollisionEntry &entry, + void compare_collider_to_node(CollisionEntry &entry, const GeometricBoundingVolume *from_parent_gbv, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *into_node_gbv); - void compare_collider_to_geom_node(qpCollisionEntry &entry, + void compare_collider_to_geom_node(CollisionEntry &entry, const GeometricBoundingVolume *from_parent_gbv, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *into_node_gbv); - void compare_collider_to_solid(qpCollisionEntry &entry, + void compare_collider_to_solid(CollisionEntry &entry, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *solid_gbv); - void compare_collider_to_geom(qpCollisionEntry &entry, Geom *geom, + void compare_collider_to_geom(CollisionEntry &entry, Geom *geom, const GeometricBoundingVolume *from_node_gbv, const GeometricBoundingVolume *solid_gbv); private: - PT(qpCollisionHandler) _default_handler; + PT(CollisionHandler) _default_handler; TypeHandle _graph_type; - typedef pmap Colliders; + typedef pmap Colliders; Colliders _colliders; - typedef pvector OrderedColliders; + typedef pvector OrderedColliders; OrderedColliders _ordered_colliders; - typedef pmap Handlers; + typedef pmap Handlers; Handlers _handlers; // Statistics static PStatCollector _collisions_pcollector; }; -INLINE ostream &operator << (ostream &out, const qpCollisionTraverser &trav) { +INLINE ostream &operator << (ostream &out, const CollisionTraverser &trav) { trav.output(out); return out; } -#include "qpcollisionTraverser.I" +#include "collisionTraverser.I" #endif diff --git a/panda/src/collide/config_collide.cxx b/panda/src/collide/config_collide.cxx index b60c31a5f7..c6722dd712 100644 --- a/panda/src/collide/config_collide.cxx +++ b/panda/src/collide/config_collide.cxx @@ -17,14 +17,14 @@ //////////////////////////////////////////////////////////////////// #include "config_collide.h" -#include "qpcollisionEntry.h" -#include "qpcollisionHandler.h" -#include "qpcollisionHandlerEvent.h" -#include "qpcollisionHandlerFloor.h" -#include "qpcollisionHandlerPhysical.h" -#include "qpcollisionHandlerPusher.h" -#include "qpcollisionHandlerQueue.h" -#include "qpcollisionNode.h" +#include "collisionEntry.h" +#include "collisionHandler.h" +#include "collisionHandlerEvent.h" +#include "collisionHandlerFloor.h" +#include "collisionHandlerPhysical.h" +#include "collisionHandlerPusher.h" +#include "collisionHandlerQueue.h" +#include "collisionNode.h" #include "collisionPlane.h" #include "collisionPolygon.h" #include "collisionRay.h" @@ -56,14 +56,14 @@ init_libcollide() { } initialized = true; - qpCollisionEntry::init_type(); - qpCollisionHandler::init_type(); - qpCollisionHandlerEvent::init_type(); - qpCollisionHandlerFloor::init_type(); - qpCollisionHandlerPhysical::init_type(); - qpCollisionHandlerPusher::init_type(); - qpCollisionHandlerQueue::init_type(); - qpCollisionNode::init_type(); + CollisionEntry::init_type(); + CollisionHandler::init_type(); + CollisionHandlerEvent::init_type(); + CollisionHandlerFloor::init_type(); + CollisionHandlerPhysical::init_type(); + CollisionHandlerPusher::init_type(); + CollisionHandlerQueue::init_type(); + CollisionNode::init_type(); CollisionPlane::init_type(); CollisionPolygon::init_type(); CollisionRay::init_type(); @@ -73,7 +73,7 @@ init_libcollide() { //Registration of writeable object's creation //functions with BamReader's factory - qpCollisionNode::register_with_read_factory(); + CollisionNode::register_with_read_factory(); CollisionPlane::register_with_read_factory(); CollisionPolygon::register_with_read_factory(); CollisionRay::register_with_read_factory(); diff --git a/panda/src/crgsg/crGraphicsStateGuardian.cxx b/panda/src/crgsg/crGraphicsStateGuardian.cxx index 74c975a336..e62753f0d9 100644 --- a/panda/src/crgsg/crGraphicsStateGuardian.cxx +++ b/panda/src/crgsg/crGraphicsStateGuardian.cxx @@ -53,10 +53,10 @@ #include "renderModeAttrib.h" #include "fogAttrib.h" #include "depthOffsetAttrib.h" -#include "qpfog.h" +#include "fog.h" #include "clockObject.h" #include "string_utils.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "dcast.h" #include "pvector.h" @@ -801,7 +801,7 @@ draw_sprite(GeomSprite *geom, GeomContext *) { if (!geom->get_alpha_disable()) { // figure out if alpha's enabled (if not, no reason to sort) - const TransparencyAttrib *trans = _qpstate->get_transparency(); + const TransparencyAttrib *trans = _state->get_transparency(); if (trans != (const TransparencyAttrib *)NULL) { alpha = (trans->get_mode() != TransparencyAttrib::M_none); } @@ -1598,7 +1598,7 @@ release_texture(TextureContext *tc) { // contents of the node. //////////////////////////////////////////////////////////////////// GeomNodeContext *CRGraphicsStateGuardian:: -prepare_geom_node(qpGeomNode *node) { +prepare_geom_node(GeomNode *node) { #if 0 // temporarily disabled until we bring to new scene graph // Make sure we have at least some static Geoms in the GeomNode; @@ -1695,7 +1695,7 @@ prepare_geom_node(qpGeomNode *node) { // prepare_geom_node(). //////////////////////////////////////////////////////////////////// void CRGraphicsStateGuardian:: -draw_geom_node(qpGeomNode *node, const RenderState *state, +draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) { #if 0 // temporarily disabled until we bring to new scene graph if (gnc == (GeomNodeContext *)NULL) { @@ -2010,11 +2010,11 @@ void CRGraphicsStateGuardian::apply_material(const Material *material) { // Description: //////////////////////////////////////////////////////////////////// void CRGraphicsStateGuardian:: -apply_fog(qpFog *fog) { - qpFog::Mode fmode = fog->get_mode(); +apply_fog(Fog *fog) { + Fog::Mode fmode = fog->get_mode(); call_glFogMode(get_fog_mode_type((Fog::Mode)fmode)); - if (fmode == qpFog::M_linear) { + if (fmode == Fog::M_linear) { float onset, opaque; fog->get_linear_range(onset, opaque); call_glFogStart(onset); @@ -2225,8 +2225,8 @@ void CRGraphicsStateGuardian:: issue_fog(const FogAttrib *attrib) { if (!attrib->is_off()) { enable_fog(true); - qpFog *fog = attrib->get_fog(); - nassertv(fog != (qpFog *)NULL); + Fog *fog = attrib->get_fog(); + nassertv(fog != (Fog *)NULL); apply_fog(fog); } else { enable_fog(false); @@ -2274,7 +2274,7 @@ bind_light(PointLight *light, int light_id) { // Position needs to specify x, y, z, and w // w == 1 implies non-infinite position - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LPoint3f pos = light->get_point() * light_mat; @@ -2315,7 +2315,7 @@ bind_light(DirectionalLight *light, int light_id) { // Position needs to specify x, y, z, and w. // w == 0 implies light is at infinity - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LVector3f dir = light->get_direction() * light_mat; LPoint4f fdir(-dir[0], -dir[1], -dir[2], 0); @@ -2360,7 +2360,7 @@ bind_light(Spotlight *light, int light_id) { // Position needs to specify x, y, z, and w // w == 1 implies non-infinite position - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LPoint3f pos = lens->get_nodal_point() * light_mat; LVector3f dir = lens->get_view_vector() * light_mat; diff --git a/panda/src/crgsg/crGraphicsStateGuardian.h b/panda/src/crgsg/crGraphicsStateGuardian.h index 3bc2188a4d..8bd7ceb21e 100644 --- a/panda/src/crgsg/crGraphicsStateGuardian.h +++ b/panda/src/crgsg/crGraphicsStateGuardian.h @@ -98,8 +98,8 @@ public: virtual void apply_texture(TextureContext *tc); virtual void release_texture(TextureContext *tc); - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node); - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node); + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc); virtual void release_geom_node(GeomNodeContext *gnc); @@ -121,7 +121,7 @@ public: const NodeTransitions& na=NodeTransitions()); virtual void apply_material(const Material *material); - void apply_fog(qpFog *fog); + void apply_fog(Fog *fog); virtual void issue_transform(const TransformState *transform); virtual void issue_tex_matrix(const TexMatrixAttrib *attrib); diff --git a/panda/src/device/Sources.pp b/panda/src/device/Sources.pp index 813e62b7d2..2cfdf9ff05 100644 --- a/panda/src/device/Sources.pp +++ b/panda/src/device/Sources.pp @@ -9,36 +9,36 @@ #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx #define SOURCES \ - qpanalogNode.I qpanalogNode.h \ - qpbuttonNode.I qpbuttonNode.h \ + analogNode.I analogNode.h \ + buttonNode.I buttonNode.h \ clientAnalogDevice.I clientAnalogDevice.h clientBase.I \ clientBase.h clientButtonDevice.I clientButtonDevice.h \ clientDevice.I clientDevice.h clientDialDevice.I \ clientDialDevice.h clientTrackerDevice.I \ clientTrackerDevice.h config_device.h \ - qpdialNode.I qpdialNode.h \ + dialNode.I dialNode.h \ mouseAndKeyboard.h \ trackerData.I trackerData.h \ - qptrackerNode.I qptrackerNode.h \ - qpvirtualMouse.h + trackerNode.I trackerNode.h \ + virtualMouse.h #define INCLUDED_SOURCES \ - qpanalogNode.cxx \ - qpbuttonNode.cxx \ + analogNode.cxx \ + buttonNode.cxx \ clientAnalogDevice.cxx \ clientBase.cxx clientButtonDevice.cxx clientDevice.cxx \ clientDialDevice.cxx clientTrackerDevice.cxx \ config_device.cxx \ dialNode.cxx \ - qpdialNode.cxx \ + dialNode.cxx \ mouseAndKeyboard.cxx \ trackerData.cxx \ - qptrackerNode.cxx \ - qpvirtualMouse.cxx + trackerNode.cxx \ + virtualMouse.cxx #define INSTALL_HEADERS \ - qpanalogNode.I qpanalogNode.h \ - qpbuttonNode.I qpbuttonNode.h \ + analogNode.I analogNode.h \ + buttonNode.I buttonNode.h \ clientAnalogDevice.I clientAnalogDevice.h \ clientBase.I clientBase.h \ clientButtonDevice.I clientButtonDevice.h \ @@ -47,10 +47,10 @@ clientTrackerDevice.I clientTrackerDevice.h \ config_device.h \ mouseAndKeyboard.h \ - qpdialNode.I qpdialNode.h \ + dialNode.I dialNode.h \ trackerData.I trackerData.h \ - qptrackerNode.I qptrackerNode.h \ - qpvirtualMouse.h + trackerNode.I trackerNode.h \ + virtualMouse.h #define IGATESCAN all diff --git a/panda/src/device/qpanalogNode.I b/panda/src/device/analogNode.I similarity index 85% rename from panda/src/device/qpanalogNode.I rename to panda/src/device/analogNode.I index aafb4746d5..b71ff8f80a 100644 --- a/panda/src/device/qpanalogNode.I +++ b/panda/src/device/analogNode.I @@ -1,4 +1,4 @@ -// Filename: qpanalogNode.I +// Filename: analogNode.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,35 +18,35 @@ //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::OutputData::Constructor +// Function: AnalogNode::OutputData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpAnalogNode::OutputData:: +INLINE AnalogNode::OutputData:: OutputData() { _index = -1; _flip = false; } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::is_valid +// Function: AnalogNode::is_valid // Access: Public -// Description: Returns true if the qpAnalogNode is valid and +// Description: Returns true if the AnalogNode is valid and // connected to a server, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpAnalogNode:: +INLINE bool AnalogNode:: is_valid() const { return (_analog != (ClientAnalogDevice *)NULL) && _analog->is_connected(); } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::get_num_controls +// Function: AnalogNode::get_num_controls // Access: Public // Description: Returns the number of analog controls known to the -// qpAnalogNode. This number may change as more controls +// AnalogNode. This number may change as more controls // are discovered. //////////////////////////////////////////////////////////////////// -INLINE int qpAnalogNode:: +INLINE int AnalogNode:: get_num_controls() const { _analog->lock(); int result = _analog->get_num_controls(); @@ -55,14 +55,14 @@ get_num_controls() const { } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::get_control_state +// Function: AnalogNode::get_control_state // Access: Public // Description: Returns the current position of indicated analog // control identified by its index number, or 0.0 if // the control is unknown. The normal range of a single // control is -1.0 to 1.0. //////////////////////////////////////////////////////////////////// -INLINE double qpAnalogNode:: +INLINE double AnalogNode:: get_control_state(int index) const { _analog->lock(); double result = _analog->get_control_state(index); @@ -71,13 +71,13 @@ get_control_state(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::is_control_known +// Function: AnalogNode::is_control_known // Access: Public // Description: Returns true if the state of the indicated analog // control is known, or false if we have never heard // anything about this particular control. //////////////////////////////////////////////////////////////////// -INLINE bool qpAnalogNode:: +INLINE bool AnalogNode:: is_control_known(int index) const { _analog->lock(); bool result = _analog->is_control_known(index); @@ -86,7 +86,7 @@ is_control_known(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::set_output +// Function: AnalogNode::set_output // Access: Public // Description: Causes a particular analog control to be placed in // the data graph for the indicated channel. Normally, @@ -95,7 +95,7 @@ is_control_known(int index) const { // available. If flip is true, the analog control value // will be reversed before outputting it. //////////////////////////////////////////////////////////////////// -INLINE void qpAnalogNode:: +INLINE void AnalogNode:: set_output(int channel, int index, bool flip) { nassertv(channel >= 0 && channel < max_outputs); _outputs[channel]._index = index; @@ -103,38 +103,38 @@ set_output(int channel, int index, bool flip) { } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::clear_output +// Function: AnalogNode::clear_output // Access: Public // Description: Removes the output to the data graph associated with // the indicated channel. See set_output(). //////////////////////////////////////////////////////////////////// -INLINE void qpAnalogNode:: +INLINE void AnalogNode:: clear_output(int channel) { nassertv(channel >= 0 && channel < max_outputs); _outputs[channel]._index = -1; } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::get_output +// Function: AnalogNode::get_output // Access: Public // Description: Returns the analog control index that is output to // the data graph on the indicated channel, or -1 if no // control is output on that channel. See set_output(). //////////////////////////////////////////////////////////////////// -INLINE int qpAnalogNode:: +INLINE int AnalogNode:: get_output(int channel) const { nassertr(channel >= 0 && channel < max_outputs, -1); return _outputs[channel]._index; } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::is_output_flipped +// Function: AnalogNode::is_output_flipped // Access: Public // Description: Returns true if the analog control index that is // output to the data graph on the indicated channel is // flipped. See set_output(). //////////////////////////////////////////////////////////////////// -INLINE bool qpAnalogNode:: +INLINE bool AnalogNode:: is_output_flipped(int channel) const { nassertr(channel >= 0 && channel < max_outputs, false); return _outputs[channel]._flip; diff --git a/panda/src/device/qpanalogNode.cxx b/panda/src/device/analogNode.cxx similarity index 88% rename from panda/src/device/qpanalogNode.cxx rename to panda/src/device/analogNode.cxx index 218cd277ec..3e15f742e2 100644 --- a/panda/src/device/qpanalogNode.cxx +++ b/panda/src/device/analogNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpanalogNode.cxx +// Filename: analogNode.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,22 +16,22 @@ // //////////////////////////////////////////////////////////////////// -#include "qpanalogNode.h" +#include "analogNode.h" #include "config_device.h" #include "dataNodeTransmit.h" #include "dcast.h" -TypeHandle qpAnalogNode::_type_handle; +TypeHandle AnalogNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::Constructor +// Function: AnalogNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpAnalogNode:: -qpAnalogNode(ClientBase *client, const string &device_name) : - qpDataNode(device_name) +AnalogNode:: +AnalogNode(ClientBase *client, const string &device_name) : + DataNode(device_name) { _xy_output = define_output("xy", EventStoreVec2::get_class_type()); _xy = new EventStoreVec2(LPoint2f(0.0f, 0.0f)); @@ -57,25 +57,25 @@ qpAnalogNode(ClientBase *client, const string &device_name) : } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::Destructor +// Function: AnalogNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpAnalogNode:: -~qpAnalogNode() { +AnalogNode:: +~AnalogNode() { // When the _analog pointer destructs, the ClientAnalogDevice // disconnects itself from the ClientBase, and everything that needs // to get turned off does. Magic. } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::write +// Function: AnalogNode::write // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpAnalogNode:: +void AnalogNode:: write(ostream &out, int indent_level) const { - qpDataNode::write(out, indent_level); + DataNode::write(out, indent_level); if (_analog != (ClientAnalogDevice *)NULL) { _analog->lock(); @@ -85,7 +85,7 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpAnalogNode::do_transmit_data +// Function: AnalogNode::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -97,7 +97,7 @@ write(ostream &out, int indent_level) const { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpAnalogNode:: +void AnalogNode:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { if (is_valid()) { _analog->poll(); diff --git a/panda/src/device/qpanalogNode.h b/panda/src/device/analogNode.h similarity index 87% rename from panda/src/device/qpanalogNode.h rename to panda/src/device/analogNode.h index 39307d2fa7..4f8c829277 100644 --- a/panda/src/device/qpanalogNode.h +++ b/panda/src/device/analogNode.h @@ -1,4 +1,4 @@ -// Filename: qpanalogNode.h +// Filename: analogNode.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,19 +16,19 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpANALOGNODE_H -#define qpANALOGNODE_H +#ifndef ANALOGNODE_H +#define ANALOGNODE_H #include "pandabase.h" #include "clientBase.h" #include "clientAnalogDevice.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "linmath_events.h" //////////////////////////////////////////////////////////////////// -// Class : qpAnalogNode +// Class : AnalogNode // Description : This is the primary interface to analog controls like // sliders and joysticks associated with a ClientBase. // This creates a node that connects to the named analog @@ -46,10 +46,10 @@ // position data. In this way, an AnalogNode may be // used in place of a mouse. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpAnalogNode : public qpDataNode { +class EXPCL_PANDA AnalogNode : public DataNode { PUBLISHED: - qpAnalogNode(ClientBase *client, const string &device_name); - virtual ~qpAnalogNode(); + AnalogNode(ClientBase *client, const string &device_name); + virtual ~AnalogNode(); INLINE bool is_valid() const; @@ -95,9 +95,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpAnalogNode", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "AnalogNode", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -108,6 +108,6 @@ private: static TypeHandle _type_handle; }; -#include "qpanalogNode.I" +#include "analogNode.I" #endif diff --git a/panda/src/device/qpbuttonNode.I b/panda/src/device/buttonNode.I similarity index 86% rename from panda/src/device/qpbuttonNode.I rename to panda/src/device/buttonNode.I index 7219f10398..d251a78642 100644 --- a/panda/src/device/qpbuttonNode.I +++ b/panda/src/device/buttonNode.I @@ -1,4 +1,4 @@ -// Filename: qpbuttonNode.I +// Filename: buttonNode.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,27 +18,27 @@ //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::is_valid +// Function: ButtonNode::is_valid // Access: Public -// Description: Returns true if the qpButtonNode is valid and +// Description: Returns true if the ButtonNode is valid and // connected to a server, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpButtonNode:: +INLINE bool ButtonNode:: is_valid() const { return (_button != (ClientButtonDevice *)NULL) && _button->is_connected(); } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::get_num_buttons +// Function: ButtonNode::get_num_buttons // Access: Public // Description: Returns the number of buttons known to the -// qpButtonNode. This includes those buttons whose state +// ButtonNode. This includes those buttons whose state // has been seen, as well as buttons that have been // associated with a ButtonHandle even if their state is // unknown. This number may change as more buttons are // discovered. //////////////////////////////////////////////////////////////////// -INLINE int qpButtonNode:: +INLINE int ButtonNode:: get_num_buttons() const { _button->lock(); int result = _button->get_num_buttons(); @@ -47,7 +47,7 @@ get_num_buttons() const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::set_button_map +// Function: ButtonNode::set_button_map // Access: Public // Description: Associates the indicated ButtonHandle with the button // of the indicated index number. When the given button @@ -60,7 +60,7 @@ get_num_buttons() const { // number; this is only necessary in order to generate // ButtonEvents when the buttons change state. //////////////////////////////////////////////////////////////////// -INLINE void qpButtonNode:: +INLINE void ButtonNode:: set_button_map(int index, ButtonHandle button) { _button->lock(); _button->set_button_map(index, button); @@ -68,14 +68,14 @@ set_button_map(int index, ButtonHandle button) { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::get_button_map +// Function: ButtonNode::get_button_map // Access: Public // Description: Returns the ButtonHandle that was previously // associated with the given index number by // a call to set_button_map(), or ButtonHandle::none() // if no button was associated. //////////////////////////////////////////////////////////////////// -INLINE ButtonHandle qpButtonNode:: +INLINE ButtonHandle ButtonNode:: get_button_map(int index) const { _button->lock(); ButtonHandle result = _button->get_button_map(index); @@ -84,13 +84,13 @@ get_button_map(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::get_button_state +// Function: ButtonNode::get_button_state // Access: Public // Description: Returns true if the indicated button (identified by // its index number) is currently known to be down, or // false if it is up or unknown. //////////////////////////////////////////////////////////////////// -INLINE bool qpButtonNode:: +INLINE bool ButtonNode:: get_button_state(int index) const { _button->lock(); bool result = _button->get_button_state(index); @@ -99,13 +99,13 @@ get_button_state(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::is_button_known +// Function: ButtonNode::is_button_known // Access: Public // Description: Returns true if the state of the indicated button is // known, or false if we have never heard anything about // this particular button. //////////////////////////////////////////////////////////////////// -INLINE bool qpButtonNode:: +INLINE bool ButtonNode:: is_button_known(int index) const { _button->lock(); bool result = _button->is_button_known(index); diff --git a/panda/src/device/qpbuttonNode.cxx b/panda/src/device/buttonNode.cxx similarity index 87% rename from panda/src/device/qpbuttonNode.cxx rename to panda/src/device/buttonNode.cxx index a6f2df8a59..e653484c6d 100644 --- a/panda/src/device/qpbuttonNode.cxx +++ b/panda/src/device/buttonNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpbuttonNode.cxx +// Filename: buttonNode.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,22 +16,22 @@ // //////////////////////////////////////////////////////////////////// -#include "qpbuttonNode.h" +#include "buttonNode.h" #include "config_device.h" #include "dataNodeTransmit.h" #include "buttonEventList.h" #include "dcast.h" -TypeHandle qpButtonNode::_type_handle; +TypeHandle ButtonNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::Constructor +// Function: ButtonNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpButtonNode:: -qpButtonNode(ClientBase *client, const string &device_name) : - qpDataNode(device_name) +ButtonNode:: +ButtonNode(ClientBase *client, const string &device_name) : + DataNode(device_name) { _button_events_output = define_output("button_events", ButtonEventList::get_class_type()); _button_events = new ButtonEventList; @@ -57,25 +57,25 @@ qpButtonNode(ClientBase *client, const string &device_name) : } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::Destructor +// Function: ButtonNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpButtonNode:: -~qpButtonNode() { +ButtonNode:: +~ButtonNode() { // When the _button pointer destructs, the ClientButtonDevice // disconnects itself from the ClientBase, and everything that needs // to get turned off does. Magic. } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::output +// Function: ButtonNode::output // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpButtonNode:: +void ButtonNode:: output(ostream &out) const { - qpDataNode::output(out); + DataNode::output(out); if (_button != (ClientButtonDevice *)NULL) { out << " ("; @@ -87,13 +87,13 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::write +// Function: ButtonNode::write // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpButtonNode:: +void ButtonNode:: write(ostream &out, int indent_level) const { - qpDataNode::write(out, indent_level); + DataNode::write(out, indent_level); if (_button != (ClientButtonDevice *)NULL) { _button->lock(); @@ -103,7 +103,7 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonNode::do_transmit_data +// Function: ButtonNode::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -115,7 +115,7 @@ write(ostream &out, int indent_level) const { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpButtonNode:: +void ButtonNode:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { if (is_valid()) { _button->poll(); diff --git a/panda/src/device/qpbuttonNode.h b/panda/src/device/buttonNode.h similarity index 85% rename from panda/src/device/qpbuttonNode.h rename to panda/src/device/buttonNode.h index 48db3ffaea..d7bc4f9c2a 100644 --- a/panda/src/device/qpbuttonNode.h +++ b/panda/src/device/buttonNode.h @@ -1,4 +1,4 @@ -// Filename: qpButtonNode.h +// Filename: ButtonNode.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,19 +16,19 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpBUTTONNODE_H -#define qpBUTTONNODE_H +#ifndef BUTTONNODE_H +#define BUTTONNODE_H #include "pandabase.h" #include "clientBase.h" #include "clientButtonDevice.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "buttonEventList.h" //////////////////////////////////////////////////////////////////// -// Class : qpButtonNode +// Class : ButtonNode // Description : This is the primary interface to on/off button // devices associated with a ClientBase. This creates a // node that connects to the named button device, if it @@ -42,10 +42,10 @@ // down events on the data graph for each button state // change. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpButtonNode : public qpDataNode { +class EXPCL_PANDA ButtonNode : public DataNode { PUBLISHED: - qpButtonNode(ClientBase *client, const string &device_name); - virtual ~qpButtonNode(); + ButtonNode(ClientBase *client, const string &device_name); + virtual ~ButtonNode(); INLINE bool is_valid() const; @@ -79,9 +79,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpButtonNode", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "ButtonNode", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -92,6 +92,6 @@ private: static TypeHandle _type_handle; }; -#include "qpbuttonNode.I" +#include "buttonNode.I" #endif diff --git a/panda/src/device/config_device.cxx b/panda/src/device/config_device.cxx index 7696920ab8..86e6dac7cf 100644 --- a/panda/src/device/config_device.cxx +++ b/panda/src/device/config_device.cxx @@ -18,18 +18,18 @@ #include "config_device.h" -#include "qpanalogNode.h" -#include "qpbuttonNode.h" +#include "analogNode.h" +#include "buttonNode.h" #include "clientAnalogDevice.h" #include "clientBase.h" #include "clientButtonDevice.h" #include "clientDevice.h" #include "clientDialDevice.h" #include "clientTrackerDevice.h" -#include "qpdialNode.h" +#include "dialNode.h" #include "mouseAndKeyboard.h" -#include "qptrackerNode.h" -#include "qpvirtualMouse.h" +#include "trackerNode.h" +#include "virtualMouse.h" #include @@ -58,16 +58,16 @@ init_libdevice() { } initialized = true; - qpAnalogNode::init_type(); - qpButtonNode::init_type(); + AnalogNode::init_type(); + ButtonNode::init_type(); ClientAnalogDevice::init_type(); ClientBase::init_type(); ClientButtonDevice::init_type(); ClientDevice::init_type(); ClientDialDevice::init_type(); ClientTrackerDevice::init_type(); - qpDialNode::init_type(); - qpMouseAndKeyboard::init_type(); - qpTrackerNode::init_type(); - qpVirtualMouse::init_type(); + DialNode::init_type(); + MouseAndKeyboard::init_type(); + TrackerNode::init_type(); + VirtualMouse::init_type(); } diff --git a/panda/src/device/device_composite2.cxx b/panda/src/device/device_composite2.cxx index 59d25823f2..9457fca14c 100644 --- a/panda/src/device/device_composite2.cxx +++ b/panda/src/device/device_composite2.cxx @@ -1,10 +1,10 @@ #include "config_device.cxx" -#include "qpanalogNode.cxx" -#include "qpbuttonNode.cxx" -#include "qpdialNode.cxx" +#include "analogNode.cxx" +#include "buttonNode.cxx" +#include "dialNode.cxx" #include "mouseAndKeyboard.cxx" #include "trackerData.cxx" -#include "qptrackerNode.cxx" -#include "qpvirtualMouse.cxx" +#include "trackerNode.cxx" +#include "virtualMouse.cxx" diff --git a/panda/src/device/qpdialNode.I b/panda/src/device/dialNode.I similarity index 84% rename from panda/src/device/qpdialNode.I rename to panda/src/device/dialNode.I index aa6d19b318..072087e290 100644 --- a/panda/src/device/qpdialNode.I +++ b/panda/src/device/dialNode.I @@ -1,4 +1,4 @@ -// Filename: qpdialNode.I +// Filename: dialNode.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,24 +18,24 @@ //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::is_valid +// Function: DialNode::is_valid // Access: Public -// Description: Returns true if the qpDialNode is valid and +// Description: Returns true if the DialNode is valid and // connected to a server, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpDialNode:: +INLINE bool DialNode:: is_valid() const { return (_dial != (ClientDialDevice *)NULL) && _dial->is_connected(); } //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::get_num_dials +// Function: DialNode::get_num_dials // Access: Public // Description: Returns the number of dial dials known to the -// qpDialNode. This number may change as more dials +// DialNode. This number may change as more dials // are discovered. //////////////////////////////////////////////////////////////////// -INLINE int qpDialNode:: +INLINE int DialNode:: get_num_dials() const { _dial->lock(); int result = _dial->get_num_dials(); @@ -44,14 +44,14 @@ get_num_dials() const { } //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::read_dial +// Function: DialNode::read_dial // Access: Public // Description: Returns the number of complete revolutions of the // dial since the last time read_dial() was called. // This is a destructive operation; it is not possible // to read the dial without resetting the counter. //////////////////////////////////////////////////////////////////// -INLINE double qpDialNode:: +INLINE double DialNode:: read_dial(int index) { _dial->lock(); double result = _dial->read_dial(index); @@ -60,13 +60,13 @@ read_dial(int index) { } //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::is_dial_known +// Function: DialNode::is_dial_known // Access: Public // Description: Returns true if the state of the indicated dial // dial is known, or false if we have never heard // anything about this particular dial. //////////////////////////////////////////////////////////////////// -INLINE bool qpDialNode:: +INLINE bool DialNode:: is_dial_known(int index) const { _dial->lock(); bool result = _dial->is_dial_known(index); diff --git a/panda/src/device/qpdialNode.cxx b/panda/src/device/dialNode.cxx similarity index 88% rename from panda/src/device/qpdialNode.cxx rename to panda/src/device/dialNode.cxx index 5664307e9c..99d52166c3 100644 --- a/panda/src/device/qpdialNode.cxx +++ b/panda/src/device/dialNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpdialNode.cxx +// Filename: dialNode.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,21 +16,21 @@ // //////////////////////////////////////////////////////////////////// -#include "qpdialNode.h" +#include "dialNode.h" #include "config_device.h" #include "dataNodeTransmit.h" #include "dcast.h" -TypeHandle qpDialNode::_type_handle; +TypeHandle DialNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::Constructor +// Function: DialNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpDialNode:: -qpDialNode(ClientBase *client, const string &device_name) : - qpDataNode(device_name) +DialNode:: +DialNode(ClientBase *client, const string &device_name) : + DataNode(device_name) { nassertv(client != (ClientBase *)NULL); PT(ClientDevice) device = @@ -53,19 +53,19 @@ qpDialNode(ClientBase *client, const string &device_name) : } //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::Destructor +// Function: DialNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpDialNode:: -~qpDialNode() { +DialNode:: +~DialNode() { // When the _dial pointer destructs, the ClientDialDevice // disconnects itself from the ClientBase, and everything that needs // to get turned off does. Magic. } //////////////////////////////////////////////////////////////////// -// Function: qpDialNode::do_transmit_data +// Function: DialNode::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -77,7 +77,7 @@ qpDialNode:: // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpDialNode:: +void DialNode:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { if (is_valid()) { _dial->poll(); diff --git a/panda/src/device/qpdialNode.h b/panda/src/device/dialNode.h similarity index 84% rename from panda/src/device/qpdialNode.h rename to panda/src/device/dialNode.h index 5f9e9f5cf8..b6379c5d4e 100644 --- a/panda/src/device/qpdialNode.h +++ b/panda/src/device/dialNode.h @@ -1,4 +1,4 @@ -// Filename: qpdialNode.h +// Filename: dialNode.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,18 +16,18 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpDIALNODE_H -#define qpDIALNODE_H +#ifndef DIALNODE_H +#define DIALNODE_H #include "pandabase.h" #include "clientBase.h" #include "clientDialDevice.h" -#include "qpdataNode.h" +#include "dataNode.h" //////////////////////////////////////////////////////////////////// -// Class : qpDialNode +// Class : DialNode // Description : This is the primary interface to infinite dial type // devices associated with a ClientBase. This creates a // node that connects to the named dial device, if it @@ -40,10 +40,10 @@ // Therefore it does not have a specific position at any // given time, unlike an AnalogDevice. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpDialNode : public qpDataNode { +class EXPCL_PANDA DialNode : public DataNode { PUBLISHED: - qpDialNode(ClientBase *client, const string &device_name); - virtual ~qpDialNode(); + DialNode(ClientBase *client, const string &device_name); + virtual ~DialNode(); INLINE bool is_valid() const; @@ -68,9 +68,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpDialNode", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "DialNode", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -81,6 +81,6 @@ private: static TypeHandle _type_handle; }; -#include "qpdialNode.I" +#include "dialNode.I" #endif diff --git a/panda/src/device/mouseAndKeyboard.cxx b/panda/src/device/mouseAndKeyboard.cxx index 9f60030737..e46299eefc 100644 --- a/panda/src/device/mouseAndKeyboard.cxx +++ b/panda/src/device/mouseAndKeyboard.cxx @@ -23,16 +23,16 @@ #include "dataNodeTransmit.h" #include "graphicsWindow.h" -TypeHandle qpMouseAndKeyboard::_type_handle; +TypeHandle MouseAndKeyboard::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpMouseAndKeyboard::Constructor +// Function: MouseAndKeyboard::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpMouseAndKeyboard:: -qpMouseAndKeyboard(GraphicsWindow *window, int device, const string &name) : - qpDataNode(name), +MouseAndKeyboard:: +MouseAndKeyboard(GraphicsWindow *window, int device, const string &name) : + DataNode(name), _window(window), _device(device) { @@ -46,7 +46,7 @@ qpMouseAndKeyboard(GraphicsWindow *window, int device, const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpMouseAndKeyboard::do_transmit_data +// Function: MouseAndKeyboard::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -58,7 +58,7 @@ qpMouseAndKeyboard(GraphicsWindow *window, int device, const string &name) : // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpMouseAndKeyboard:: +void MouseAndKeyboard:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { if (_window->has_button_event(_device)) { // Fill up the button events. diff --git a/panda/src/device/mouseAndKeyboard.h b/panda/src/device/mouseAndKeyboard.h index e95968f4b6..17294f0762 100644 --- a/panda/src/device/mouseAndKeyboard.h +++ b/panda/src/device/mouseAndKeyboard.h @@ -21,7 +21,7 @@ #include "pandabase.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "buttonEventList.h" #include "linmath_events.h" #include "pointerTo.h" @@ -47,9 +47,9 @@ // EventThrower to the MouseAndKeyboard object; // otherwise, the events will be discarded. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpMouseAndKeyboard : public qpDataNode { +class EXPCL_PANDA MouseAndKeyboard : public DataNode { PUBLISHED: - qpMouseAndKeyboard(GraphicsWindow *window, int device, + MouseAndKeyboard(GraphicsWindow *window, int device, const string &name); protected: @@ -75,9 +75,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpMouseAndKeyboard", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "MouseAndKeyboard", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/device/qptrackerNode.I b/panda/src/device/trackerNode.I similarity index 78% rename from panda/src/device/qptrackerNode.I rename to panda/src/device/trackerNode.I index b4937bbb82..06d1f87c24 100644 --- a/panda/src/device/qptrackerNode.I +++ b/panda/src/device/trackerNode.I @@ -1,4 +1,4 @@ -// Filename: qptrackerNode.I +// Filename: trackerNode.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,61 +17,61 @@ //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::is_valid +// Function: TrackerNode::is_valid // Access: Public -// Description: Returns true if the qpTrackerNode is valid and +// Description: Returns true if the TrackerNode is valid and // connected to a server, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpTrackerNode:: +INLINE bool TrackerNode:: is_valid() const { return (_tracker != (ClientTrackerDevice *)NULL) && _tracker->is_connected(); } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::get_pos +// Function: TrackerNode::get_pos // Access: Public // Description: Returns the current position of the tracker, if it is // available. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpTrackerNode:: +INLINE const LPoint3f &TrackerNode:: get_pos() const { return _data.get_pos(); } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::get_orient +// Function: TrackerNode::get_orient // Access: Public // Description: Returns the current orientation of the tracker, if it // is available. //////////////////////////////////////////////////////////////////// -INLINE const LOrientationf &qpTrackerNode:: +INLINE const LOrientationf &TrackerNode:: get_orient() const { return _data.get_orient(); } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::get_transform +// Function: TrackerNode::get_transform // Access: Public // Description: Returns the current position and orientation of the // tracker, as a combined matrix. //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpTrackerNode:: +INLINE const LMatrix4f &TrackerNode:: get_transform() const { return _mat; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::set_tracker_coordinate_system +// Function: TrackerNode::set_tracker_coordinate_system // Access: Published // Description: Specifies the coordinate system that the tracker // associated with this node will operate in. Normally, // this is set from the ClientBase that's used to create -// the qpTrackerNode, so it should not need to be set on +// the TrackerNode, so it should not need to be set on // an individual tracker basis. //////////////////////////////////////////////////////////////////// -INLINE void qpTrackerNode:: +INLINE void TrackerNode:: set_tracker_coordinate_system(CoordinateSystem cs) { _tracker_cs = cs; if (_tracker_cs == CS_default) { @@ -80,24 +80,24 @@ set_tracker_coordinate_system(CoordinateSystem cs) { } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::get_tracker_coordinate_system +// Function: TrackerNode::get_tracker_coordinate_system // Access: Published // Description: Returns the coordinate system that the tracker // associated with this node will operate in. //////////////////////////////////////////////////////////////////// -INLINE CoordinateSystem qpTrackerNode:: +INLINE CoordinateSystem TrackerNode:: get_tracker_coordinate_system() const { return _tracker_cs; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::set_graph_coordinate_system +// Function: TrackerNode::set_graph_coordinate_system // Access: Published -// Description: Specifies the coordinate system that the qpTrackerNode +// Description: Specifies the coordinate system that the TrackerNode // will convert its transform into for passing down the // data graph. Normally, this is CS_default. //////////////////////////////////////////////////////////////////// -INLINE void qpTrackerNode:: +INLINE void TrackerNode:: set_graph_coordinate_system(CoordinateSystem cs) { _graph_cs = cs; if (_graph_cs == CS_default) { @@ -106,13 +106,13 @@ set_graph_coordinate_system(CoordinateSystem cs) { } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::get_graph_coordinate_system +// Function: TrackerNode::get_graph_coordinate_system // Access: Published -// Description: Returns the coordinate system that the qpTrackerNode +// Description: Returns the coordinate system that the TrackerNode // will convert its transform into for passing down the // data graph. Normally, this is CS_default. //////////////////////////////////////////////////////////////////// -INLINE CoordinateSystem qpTrackerNode:: +INLINE CoordinateSystem TrackerNode:: get_graph_coordinate_system() const { return _graph_cs; } diff --git a/panda/src/device/qptrackerNode.cxx b/panda/src/device/trackerNode.cxx similarity index 89% rename from panda/src/device/qptrackerNode.cxx rename to panda/src/device/trackerNode.cxx index 09edce4dc2..efc49d0667 100644 --- a/panda/src/device/qptrackerNode.cxx +++ b/panda/src/device/trackerNode.cxx @@ -1,4 +1,4 @@ -// Filename: qptrackerNode.cxx +// Filename: trackerNode.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,19 +16,19 @@ // //////////////////////////////////////////////////////////////////// -#include "qptrackerNode.h" +#include "trackerNode.h" #include "config_device.h" -TypeHandle qpTrackerNode::_type_handle; +TypeHandle TrackerNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::Constructor +// Function: TrackerNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpTrackerNode:: -qpTrackerNode(ClientBase *client, const string &device_name) : - qpDataNode(device_name) +TrackerNode:: +TrackerNode(ClientBase *client, const string &device_name) : + DataNode(device_name) { _transform_output = define_output("transform", EventStoreMat4::get_class_type()); @@ -58,19 +58,19 @@ qpTrackerNode(ClientBase *client, const string &device_name) : } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::Destructor +// Function: TrackerNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpTrackerNode:: -~qpTrackerNode() { +TrackerNode:: +~TrackerNode() { // When the _tracker pointer destructs, the ClientTrackerDevice // disconnects itself from the ClientBase, and everything that needs // to get turned off does. Magic. } //////////////////////////////////////////////////////////////////// -// Function: qpTrackerNode::do_transmit_data +// Function: TrackerNode::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -82,7 +82,7 @@ qpTrackerNode:: // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpTrackerNode:: +void TrackerNode:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { if (is_valid()) { _tracker->poll(); diff --git a/panda/src/device/qptrackerNode.h b/panda/src/device/trackerNode.h similarity index 85% rename from panda/src/device/qptrackerNode.h rename to panda/src/device/trackerNode.h index 4e9c7b3328..32cf821ec9 100644 --- a/panda/src/device/qptrackerNode.h +++ b/panda/src/device/trackerNode.h @@ -1,4 +1,4 @@ -// Filename: qptrackerNode.h +// Filename: trackerNode.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,15 +16,15 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpTRACKERNODE_H -#define qpTRACKERNODE_H +#ifndef TRACKERNODE_H +#define TRACKERNODE_H #include "pandabase.h" #include "clientBase.h" #include "trackerData.h" #include "clientTrackerDevice.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "luse.h" #include "linmath_events.h" #include "pointerTo.h" @@ -37,10 +37,10 @@ // makes it available as a transformation on the data // graph. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpTrackerNode : public qpDataNode { +class EXPCL_PANDA TrackerNode : public DataNode { PUBLISHED: - qpTrackerNode(ClientBase *client, const string &device_name); - virtual ~qpTrackerNode(); + TrackerNode(ClientBase *client, const string &device_name); + virtual ~TrackerNode(); INLINE bool is_valid() const; @@ -76,9 +76,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpTrackerNode", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "TrackerNode", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -89,6 +89,6 @@ private: static TypeHandle _type_handle; }; -#include "qptrackerNode.I" +#include "trackerNode.I" #endif diff --git a/panda/src/device/qpvirtualMouse.cxx b/panda/src/device/virtualMouse.cxx similarity index 88% rename from panda/src/device/qpvirtualMouse.cxx rename to panda/src/device/virtualMouse.cxx index eb2fcd71c0..42379ecd24 100644 --- a/panda/src/device/qpvirtualMouse.cxx +++ b/panda/src/device/virtualMouse.cxx @@ -1,4 +1,4 @@ -// Filename: qpvirtualMouse.cxx +// Filename: virtualMouse.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,18 +16,18 @@ // //////////////////////////////////////////////////////////////////// -#include "qpvirtualMouse.h" +#include "virtualMouse.h" -TypeHandle qpVirtualMouse::_type_handle; +TypeHandle VirtualMouse::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::Constructor +// Function: VirtualMouse::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpVirtualMouse:: -qpVirtualMouse(const string &name) : - qpDataNode(name) +VirtualMouse:: +VirtualMouse(const string &name) : + DataNode(name) { _pixel_xy_output = define_output("pixel_xy", EventStoreVec2::get_class_type()); _xy_output = define_output("xy", EventStoreVec2::get_class_type()); @@ -46,70 +46,70 @@ qpVirtualMouse(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::set_mouse_pos +// Function: VirtualMouse::set_mouse_pos // Access: Published // Description: Sets the current mouse pixel location, where (0,0) is // the upper left, and (width-1, height-1) is the lower // right pixel of the virtual window. //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: set_mouse_pos(int x, int y) { _mouse_x = x; _mouse_y = y; } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::set_window_size +// Function: VirtualMouse::set_window_size // Access: Published // Description: Sets the size of the "window" in which the mouse // rolls. This changes the meaning of the values passed // to set_mouse_pos(). //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: set_window_size(int width, int height) { _win_width = width; _win_height = height; } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::set_mouse_on +// Function: VirtualMouse::set_mouse_on // Access: Published // Description: Sets whether the mouse should appear to be within the // window or not. If this is true, the mouse is within // the window; if false, the mouse is not within the // window (and set_mouse_pos() means nothing). //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: set_mouse_on(bool flag) { _mouse_on = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::press_button +// Function: VirtualMouse::press_button // Access: Published // Description: Simulates a mouse or keyboard button being depressed. // This should be followed up by a call to // release_button() sometime later (possibly // immediately). //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: press_button(ButtonHandle button) { _next_button_events->add_event(ButtonEvent(button, ButtonEvent::T_down)); } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::release_button +// Function: VirtualMouse::release_button // Access: Published // Description: Simulates the button being released. This should // follow a previous call to press_button(). //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: release_button(ButtonHandle button) { _next_button_events->add_event(ButtonEvent(button, ButtonEvent::T_up)); } //////////////////////////////////////////////////////////////////// -// Function: qpVirtualMouse::do_transmit_data +// Function: VirtualMouse::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -121,7 +121,7 @@ release_button(ButtonHandle button) { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpVirtualMouse:: +void VirtualMouse:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &output) { // Swap in the button events, and clear them for next time. PT(ButtonEventList) events = _button_events; diff --git a/panda/src/device/qpvirtualMouse.h b/panda/src/device/virtualMouse.h similarity index 86% rename from panda/src/device/qpvirtualMouse.h rename to panda/src/device/virtualMouse.h index a636c21da6..254ab86edf 100644 --- a/panda/src/device/qpvirtualMouse.h +++ b/panda/src/device/virtualMouse.h @@ -1,4 +1,4 @@ -// Filename: qpvirtualMouse.h +// Filename: virtualMouse.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,18 +16,18 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpVIRTUALMOUSE_H -#define qpVIRTUALMOUSE_H +#ifndef VIRTUALMOUSE_H +#define VIRTUALMOUSE_H #include "pandabase.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "buttonHandle.h" #include "buttonEvent.h" #include "pointerTo.h" //////////////////////////////////////////////////////////////////// -// Class : qpVirtualMouse +// Class : VirtualMouse // Description : Poses as a MouseAndKeyboard object in the datagraph, // but accepts input from user calls, rather than // reading the actual mouse and keyboard from an input @@ -35,9 +35,9 @@ // the mouse wherever he/she wants, and to insert // keypresses on demand. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpVirtualMouse : public qpDataNode { +class EXPCL_PANDA VirtualMouse : public DataNode { PUBLISHED: - qpVirtualMouse(const string &name); + VirtualMouse(const string &name); void set_mouse_pos(int x, int y); void set_window_size(int width, int height); @@ -72,9 +72,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpVirtualMouse", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "VirtualMouse", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/dgraph/Sources.pp b/panda/src/dgraph/Sources.pp index f8a66ddd3a..0c3225f590 100644 --- a/panda/src/dgraph/Sources.pp +++ b/panda/src/dgraph/Sources.pp @@ -10,20 +10,20 @@ #define SOURCES \ config_dgraph.h \ - qpdataGraphTraverser.I qpdataGraphTraverser.h \ - qpdataNode.I qpdataNode.h \ + dataGraphTraverser.I dataGraphTraverser.h \ + dataNode.I dataNode.h \ dataNodeTransmit.I dataNodeTransmit.h #define INCLUDED_SOURCES \ config_dgraph.cxx \ - qpdataGraphTraverser.cxx \ - qpdataNode.cxx \ + dataGraphTraverser.cxx \ + dataNode.cxx \ dataNodeTransmit.cxx #define INSTALL_HEADERS \ config_dgraph.h \ - qpdataGraphTraverser.I qpdataGraphTraverser.h \ - qpdataNode.I qpdataNode.h \ + dataGraphTraverser.I dataGraphTraverser.h \ + dataNode.I dataNode.h \ dataNodeTransmit.I dataNodeTransmit.h #define IGATESCAN \ diff --git a/panda/src/dgraph/config_dgraph.cxx b/panda/src/dgraph/config_dgraph.cxx index 2f873af3f8..12f9876e72 100644 --- a/panda/src/dgraph/config_dgraph.cxx +++ b/panda/src/dgraph/config_dgraph.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "config_dgraph.h" -#include "qpdataNode.h" +#include "dataNode.h" #include @@ -25,5 +25,5 @@ Configure(config_dgraph); NotifyCategoryDef(dgraph, ""); ConfigureFn(config_dgraph) { - qpDataNode::init_type(); + DataNode::init_type(); } diff --git a/panda/src/dgraph/qpdataGraphTraverser.I b/panda/src/dgraph/dataGraphTraverser.I similarity index 85% rename from panda/src/dgraph/qpdataGraphTraverser.I rename to panda/src/dgraph/dataGraphTraverser.I index f46eecd012..fdcdb9fda1 100644 --- a/panda/src/dgraph/qpdataGraphTraverser.I +++ b/panda/src/dgraph/dataGraphTraverser.I @@ -1,4 +1,4 @@ -// Filename: qpdataGraphTraverser.I +// Filename: dataGraphTraverser.I // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,11 +18,11 @@ //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::CollectedData::Constructor +// Function: DataGraphTraverser::CollectedData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpDataGraphTraverser::CollectedData:: +INLINE DataGraphTraverser::CollectedData:: CollectedData() : _num_parents(0) { diff --git a/panda/src/dgraph/qpdataGraphTraverser.cxx b/panda/src/dgraph/dataGraphTraverser.cxx similarity index 84% rename from panda/src/dgraph/qpdataGraphTraverser.cxx rename to panda/src/dgraph/dataGraphTraverser.cxx index f3fa11cba7..95e5c86bc4 100644 --- a/panda/src/dgraph/qpdataGraphTraverser.cxx +++ b/panda/src/dgraph/dataGraphTraverser.cxx @@ -1,4 +1,4 @@ -// Filename: qpdataGraphTraverser.cxx +// Filename: dataGraphTraverser.cxx // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,19 +16,19 @@ // //////////////////////////////////////////////////////////////////// -#include "qpdataGraphTraverser.h" -#include "qpdataNode.h" +#include "dataGraphTraverser.h" +#include "dataNode.h" #include "config_dgraph.h" #include "dcast.h" //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::CollectedData::set_data +// Function: DataGraphTraverser::CollectedData::set_data // Access: Public // Description: Sets the data associated with the indicated parent of // this CollectedData object's node. //////////////////////////////////////////////////////////////////// -void qpDataGraphTraverser::CollectedData:: +void DataGraphTraverser::CollectedData:: set_data(int parent_index, const DataNodeTransmit &data) { if ((int)_data.size() <= parent_index) { _data.reserve(parent_index + 1); @@ -42,33 +42,33 @@ set_data(int parent_index, const DataNodeTransmit &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::Constructor +// Function: DataGraphTraverser::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpDataGraphTraverser:: -qpDataGraphTraverser() { +DataGraphTraverser:: +DataGraphTraverser() { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::Destructor +// Function: DataGraphTraverser::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpDataGraphTraverser:: -~qpDataGraphTraverser() { +DataGraphTraverser:: +~DataGraphTraverser() { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::traverse +// Function: DataGraphTraverser::traverse // Access: Public // Description: Starts the traversal of the data graph at the // indicated root node. //////////////////////////////////////////////////////////////////// -void qpDataGraphTraverser:: +void DataGraphTraverser:: traverse(PandaNode *node) { - if (node->is_of_type(qpDataNode::get_class_type())) { - qpDataNode *data_node = DCAST(qpDataNode, node); + if (node->is_of_type(DataNode::get_class_type())) { + DataNode *data_node = DCAST(DataNode, node); int num_parents = data_node->get_num_parents(); // We must start the traversal at the root of the graph. nassertv(num_parents == 0); @@ -83,21 +83,21 @@ traverse(PandaNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::traverse_below +// Function: DataGraphTraverser::traverse_below // Access: Public // Description: Continues the traversal to all the children of the // indicated node, passing in the given data, without // actually calling transmit_data() on the given node. //////////////////////////////////////////////////////////////////// -void qpDataGraphTraverser:: +void DataGraphTraverser:: traverse_below(PandaNode *node, const DataNodeTransmit &output) { PandaNode::Children cr = node->get_children(); int num_children = cr.get_num_children(); for (int i = 0; i < num_children; i++) { PandaNode *child_node = cr.get_child(i); - if (child_node->is_of_type(qpDataNode::get_class_type())) { - qpDataNode *data_node = DCAST(qpDataNode, child_node); + if (child_node->is_of_type(DataNode::get_class_type())) { + DataNode *data_node = DCAST(DataNode, child_node); // If it's a DataNode-type child, we need to pass it the data. // Maybe it has only one parent, and can accept the data // immediately. @@ -137,18 +137,18 @@ traverse_below(PandaNode *node, const DataNodeTransmit &output) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::collect_leftovers +// Function: DataGraphTraverser::collect_leftovers // Access: Public // Description: Pick up any nodes that didn't get completely // traversed. These must be nodes that have multiple // parents, with at least one parent completely outside // of the data graph. //////////////////////////////////////////////////////////////////// -void qpDataGraphTraverser:: +void DataGraphTraverser:: collect_leftovers() { while (!_multipass_data.empty()) { MultipassData::iterator mi = _multipass_data.begin(); - qpDataNode *data_node = (*mi).first; + DataNode *data_node = (*mi).first; const CollectedData &collected_data = (*mi).second; dgraph_cat.warning() @@ -160,15 +160,15 @@ collect_leftovers() { } //////////////////////////////////////////////////////////////////// -// Function: qpDataGraphTraverser::r_transmit +// Function: DataGraphTraverser::r_transmit // Access: Private // Description: Part of the recursive implementation of traverse(). // This transmits the given data into the indicated // DataNode, and then sends the output data to each of // the node's children. //////////////////////////////////////////////////////////////////// -void qpDataGraphTraverser:: -r_transmit(qpDataNode *data_node, const DataNodeTransmit inputs[]) { +void DataGraphTraverser:: +r_transmit(DataNode *data_node, const DataNodeTransmit inputs[]) { DataNodeTransmit output; output.reserve(data_node->get_num_outputs()); data_node->transmit_data(inputs, output); diff --git a/panda/src/dgraph/qpdataGraphTraverser.h b/panda/src/dgraph/dataGraphTraverser.h similarity index 81% rename from panda/src/dgraph/qpdataGraphTraverser.h rename to panda/src/dgraph/dataGraphTraverser.h index a4e6226bdd..8b7ed45cc8 100644 --- a/panda/src/dgraph/qpdataGraphTraverser.h +++ b/panda/src/dgraph/dataGraphTraverser.h @@ -1,4 +1,4 @@ -// Filename: qpdataGraphTraverser.h +// Filename: dataGraphTraverser.h // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpDATAGRAPHTRAVERSER_H -#define qpDATAGRAPHTRAVERSER_H +#ifndef DATAGRAPHTRAVERSER_H +#define DATAGRAPHTRAVERSER_H #include "pandabase.h" @@ -25,7 +25,7 @@ #include "pvector.h" #include "pmap.h" -class qpDataNode; +class DataNode; class PandaNode; //////////////////////////////////////////////////////////////////// @@ -36,17 +36,17 @@ class PandaNode; // input devices, etc. See the overview of the data // graph in dataNode.h. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpDataGraphTraverser { +class EXPCL_PANDA DataGraphTraverser { PUBLISHED: - qpDataGraphTraverser(); - ~qpDataGraphTraverser(); + DataGraphTraverser(); + ~DataGraphTraverser(); void traverse(PandaNode *node); void traverse_below(PandaNode *node, const DataNodeTransmit &output); void collect_leftovers(); private: - void r_transmit(qpDataNode *data_node, const DataNodeTransmit inputs[]); + void r_transmit(DataNode *data_node, const DataNodeTransmit inputs[]); typedef pvector DataVector; @@ -58,10 +58,10 @@ private: int _num_parents; DataVector _data; }; - typedef pmap MultipassData; + typedef pmap MultipassData; MultipassData _multipass_data; }; -#include "qpdataGraphTraverser.I" +#include "dataGraphTraverser.I" #endif diff --git a/panda/src/dgraph/qpdataNode.I b/panda/src/dgraph/dataNode.I similarity index 85% rename from panda/src/dgraph/qpdataNode.I rename to panda/src/dgraph/dataNode.I index bc32b8ca4c..948d59e49e 100644 --- a/panda/src/dgraph/qpdataNode.I +++ b/panda/src/dgraph/dataNode.I @@ -1,4 +1,4 @@ -// Filename: qpdataNode.I +// Filename: dataNode.I // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,50 +18,50 @@ //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::Constructor +// Function: DataNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpDataNode:: -qpDataNode(const string &name) : +INLINE DataNode:: +DataNode(const string &name) : PandaNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::Copy Constructor +// Function: DataNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -INLINE qpDataNode:: -qpDataNode(const qpDataNode ©) : +INLINE DataNode:: +DataNode(const DataNode ©) : PandaNode(copy) { // Copying a DataNode doesn't copy its inputs or outputs. } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::get_num_inputs +// Function: DataNode::get_num_inputs // Access: Public // Description: Returns the number of different inputs that have been // defined for this node using define_input(). This // indicates the size of the DataNodeTransmit object // that should be passed to do_transmit_data(). //////////////////////////////////////////////////////////////////// -INLINE int qpDataNode:: +INLINE int DataNode:: get_num_inputs() const { return _input_wires.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::get_num_outputs +// Function: DataNode::get_num_outputs // Access: Public // Description: Returns the number of different outputs that have been // defined for this node using define_output(). This // indicates the size of the DataNodeTransmit object // that should be passed to do_transmit_data(). //////////////////////////////////////////////////////////////////// -INLINE int qpDataNode:: +INLINE int DataNode:: get_num_outputs() const { return _output_wires.size(); } diff --git a/panda/src/dgraph/qpdataNode.cxx b/panda/src/dgraph/dataNode.cxx similarity index 92% rename from panda/src/dgraph/qpdataNode.cxx rename to panda/src/dgraph/dataNode.cxx index 665a59d228..3f115cc4d5 100644 --- a/panda/src/dgraph/qpdataNode.cxx +++ b/panda/src/dgraph/dataNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpdataNode.cxx +// Filename: dataNode.cxx // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,35 +16,35 @@ // //////////////////////////////////////////////////////////////////// -#include "qpdataNode.h" +#include "dataNode.h" #include "dataNodeTransmit.h" #include "config_dgraph.h" #include "dcast.h" -TypeHandle qpDataNode::_type_handle; +TypeHandle DataNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::make_copy +// Function: DataNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpDataNode:: +PandaNode *DataNode:: make_copy() const { - return new qpDataNode(*this); + return new DataNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::transmit_data +// Function: DataNode::transmit_data // Access: Public // Description: Collects the data from all of the parent nodes and // puts it into one DataNodeTransmit object, for // processing; calls do_transmit_data() to read all the // inputs and put the result into the indicated output. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: transmit_data(const DataNodeTransmit inputs[], DataNodeTransmit &output) { DataNodeTransmit new_input; @@ -62,12 +62,12 @@ transmit_data(const DataNodeTransmit inputs[], } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::write_inputs +// Function: DataNode::write_inputs // Access: Published // Description: Writes to the indicated ostream a list of all the // inputs this DataNode might expect to receive. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: write_inputs(ostream &out) const { Wires::const_iterator wi; for (wi = _input_wires.begin(); wi != _input_wires.end(); ++wi) { @@ -78,12 +78,12 @@ write_inputs(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::write_outputs +// Function: DataNode::write_outputs // Access: Published // Description: Writes to the indicated ostream a list of all the // outputs this DataNode might generate. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: write_outputs(ostream &out) const { Wires::const_iterator wi; for (wi = _output_wires.begin(); wi != _output_wires.end(); ++wi) { @@ -94,13 +94,13 @@ write_outputs(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::write_connections +// Function: DataNode::write_connections // Access: Published // Description: Writes to the indicated ostream a list of all the // connections currently showing between this DataNode // and its parent(s). //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: write_connections(ostream &out) const { DataConnections::const_iterator ci; for (ci = _data_connections.begin(); ci != _data_connections.end(); ++ci) { @@ -125,7 +125,7 @@ write_connections(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::define_input +// Function: DataNode::define_input // Access: Protected // Description: Adds a new input wire with the given name and the // indicated data type. The data type should be the @@ -141,7 +141,7 @@ write_connections(ostream &out) const { // parameter to do_transmit_data() that can be used to // access the input data. //////////////////////////////////////////////////////////////////// -int qpDataNode:: +int DataNode:: define_input(const string &name, TypeHandle data_type) { // We shouldn't already be connected. nassertr(_data_connections.empty(), 0); @@ -164,7 +164,7 @@ define_input(const string &name, TypeHandle data_type) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::define_output +// Function: DataNode::define_output // Access: Protected // Description: Adds a new output wire with the given name and the // indicated data type. The data type should be the @@ -180,7 +180,7 @@ define_input(const string &name, TypeHandle data_type) { // parameter to do_transmit_data() where the output data // should be stored. //////////////////////////////////////////////////////////////////// -int qpDataNode:: +int DataNode:: define_output(const string &name, TypeHandle data_type) { // We shouldn't already be connected. nassertr(_data_connections.empty(), 0); @@ -203,7 +203,7 @@ define_output(const string &name, TypeHandle data_type) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::parents_changed +// Function: DataNode::parents_changed // Access: Protected, Virtual // Description: Called after a scene graph update that either adds or // remove parents from this node, this just provides a @@ -211,13 +211,13 @@ define_output(const string &name, TypeHandle data_type) { // update themselves based on the set of parents the // node has. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: parents_changed() { reconnect(); } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::do_transmit_data +// Function: DataNode::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -229,18 +229,18 @@ parents_changed() { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: do_transmit_data(const DataNodeTransmit &, DataNodeTransmit &) { } //////////////////////////////////////////////////////////////////// -// Function: qpDataNode::reconnect +// Function: DataNode::reconnect // Access: Private // Description: Establishes the input(s) that this DataNode has in // common with its parents' output(s). Builds up the // _data_connections list correspondingly. //////////////////////////////////////////////////////////////////// -void qpDataNode:: +void DataNode:: reconnect() { int num_parents = get_num_parents(); _data_connections.clear(); @@ -255,8 +255,8 @@ reconnect() { int num_found = 0; for (int i = 0; i < num_parents; i++) { PandaNode *parent_node = get_parent(i); - if (parent_node->is_of_type(qpDataNode::get_class_type())) { - qpDataNode *data_node = DCAST(qpDataNode, parent_node); + if (parent_node->is_of_type(DataNode::get_class_type())) { + DataNode *data_node = DCAST(DataNode, parent_node); num_datanode_parents++; Wires::const_iterator pi; pi = data_node->_output_wires.find(name); diff --git a/panda/src/dgraph/qpdataNode.h b/panda/src/dgraph/dataNode.h similarity index 93% rename from panda/src/dgraph/qpdataNode.h rename to panda/src/dgraph/dataNode.h index 2eba9a68c1..bdacddae2f 100644 --- a/panda/src/dgraph/qpdataNode.h +++ b/panda/src/dgraph/dataNode.h @@ -1,4 +1,4 @@ -// Filename: qpdataNode.h +// Filename: dataNode.h // Created by: drose (11Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpDATANODE_H -#define qpDATANODE_H +#ifndef DATANODE_H +#define DATANODE_H //////////////////////////////////////////////////////////////////// // @@ -53,7 +53,7 @@ class DataNodeTransmit; //////////////////////////////////////////////////////////////////// -// Class : qpDataNode +// Class : DataNode // Description : The fundamental type of node for the data graph. The // DataNode class is itself primarily intended as an // abstract class; it defines no inputs and no outputs. @@ -64,12 +64,12 @@ class DataNodeTransmit; // PipelineCycler. The data graph is intended to be // used only within a single thread. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpDataNode : public PandaNode { +class EXPCL_PANDA DataNode : public PandaNode { PUBLISHED: - INLINE qpDataNode(const string &name); + INLINE DataNode(const string &name); protected: - INLINE qpDataNode(const qpDataNode ©); + INLINE DataNode(const DataNode ©); public: virtual PandaNode *make_copy() const; @@ -125,7 +125,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpDataNode", + register_type(_type_handle, "DataNode", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -137,6 +137,6 @@ private: static TypeHandle _type_handle; }; -#include "qpdataNode.I" +#include "dataNode.I" #endif diff --git a/panda/src/dgraph/dgraph_composite1.cxx b/panda/src/dgraph/dgraph_composite1.cxx index e776c7d9ff..e53cdb4eff 100644 --- a/panda/src/dgraph/dgraph_composite1.cxx +++ b/panda/src/dgraph/dgraph_composite1.cxx @@ -1,2 +1,2 @@ #include "config_dgraph.cxx" -#include "qpdataGraphTraverser.cxx" +#include "dataGraphTraverser.cxx" diff --git a/panda/src/dgraph/dgraph_composite2.cxx b/panda/src/dgraph/dgraph_composite2.cxx index f9d063d042..cc4011ba0d 100644 --- a/panda/src/dgraph/dgraph_composite2.cxx +++ b/panda/src/dgraph/dgraph_composite2.cxx @@ -1,3 +1,3 @@ -#include "qpdataNode.cxx" +#include "dataNode.cxx" #include "dataNodeTransmit.cxx" diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index b4c3459613..fb441bf308 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -66,7 +66,7 @@ const bool cull_sorting = config_display.GetBool("cull-sorting", true); // This is normally true; set it false to disable view-frustum culling // (primarily useful for debugging). -const bool qpview_frustum_cull = config_display.GetBool("view-frustum-cull", true); +const bool view_frustum_cull = config_display.GetBool("view-frustum-cull", true); const float gsg_clear_r = config_display.GetFloat("gsg-clear-r", 0.0); const float gsg_clear_g = config_display.GetFloat("gsg-clear-g", 0.0); diff --git a/panda/src/display/config_display.h b/panda/src/display/config_display.h index 69f583b190..377e66d87c 100644 --- a/panda/src/display/config_display.h +++ b/panda/src/display/config_display.h @@ -37,7 +37,7 @@ extern const bool pipe_spec_is_remote; extern const bool compare_state_by_pointer; extern const bool cull_sorting; -extern const bool qpview_frustum_cull; +extern const bool view_frustum_cull; extern const float gsg_clear_r; extern const float gsg_clear_g; diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index 02f4597b8b..3973366ee3 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -92,14 +92,14 @@ get_layer() const { } //////////////////////////////////////////////////////////////////// -// Function: DisplayRegion::get_qpcamera +// Function: DisplayRegion::get_camera // Access: Public // Description: Returns the camera associated with this // DisplayRegion, or NULL if no camera is associated. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &DisplayRegion:: -get_qpcamera() const { - return _qpcamera; +INLINE const NodePath &DisplayRegion:: +get_camera() const { + return _camera; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/displayRegion.cxx b/panda/src/display/displayRegion.cxx index 236282baae..8af8944c16 100644 --- a/panda/src/display/displayRegion.cxx +++ b/panda/src/display/displayRegion.cxx @@ -22,7 +22,7 @@ #include "graphicsWindow.h" #include "config_display.h" #include "displayRegion.h" -#include "qpcamera.h" +#include "camera.h" #include "dcast.h" @@ -35,7 +35,7 @@ DisplayRegion:: DisplayRegion(GraphicsLayer *layer) : _l(0.), _r(1.), _b(0.), _t(1.), _layer(layer), - _camera_node((qpCamera *)NULL), + _camera_node((Camera *)NULL), _active(true) { } @@ -50,7 +50,7 @@ DisplayRegion(GraphicsLayer *layer, const float l, const float r, const float b, const float t) : _l(l), _r(r), _b(b), _t(t), _layer(layer), - _camera_node((qpCamera *)NULL), + _camera_node((Camera *)NULL), _active(true) { } @@ -67,7 +67,7 @@ DisplayRegion(int xsize, int ysize) : _l(0.), _r(1.), _b(0.), _t(1.), _pl(0), _pr(xsize), _pb(0), _pt(ysize), _layer((GraphicsLayer *)NULL), - _camera_node((qpCamera *)NULL), + _camera_node((Camera *)NULL), _active(true) { } @@ -99,7 +99,7 @@ operator = (const DisplayRegion&) { //////////////////////////////////////////////////////////////////// DisplayRegion:: ~DisplayRegion() { - set_qpcamera(qpNodePath()); + set_camera(NodePath()); } //////////////////////////////////////////////////////////////////// @@ -161,7 +161,7 @@ get_pipe() const { } //////////////////////////////////////////////////////////////////// -// Function: DisplayRegion::set_qpcamera +// Function: DisplayRegion::set_camera // Access: Public // Description: Sets the camera that is associated with this // DisplayRegion. There is a one-to-one association @@ -169,30 +169,30 @@ get_pipe() const { // was already associated with a different // DisplayRegion, that association is removed. // -// The camera is actually set via a qpNodePath, which +// The camera is actually set via a NodePath, which // clarifies which instance of the camera (if there // happen to be multiple instances) we should use. //////////////////////////////////////////////////////////////////// void DisplayRegion:: -set_qpcamera(const qpNodePath &camera) { - qpCamera *camera_node = (qpCamera *)NULL; +set_camera(const NodePath &camera) { + Camera *camera_node = (Camera *)NULL; if (!camera.is_empty()) { DCAST_INTO_V(camera_node, camera.node()); } if (camera_node != _camera_node) { - if (_camera_node != (qpCamera *)NULL) { + if (_camera_node != (Camera *)NULL) { // We need to tell the old camera we're not using him anymore. _camera_node->remove_display_region(this); } _camera_node = camera_node; - if (_camera_node != (qpCamera *)NULL) { + if (_camera_node != (Camera *)NULL) { // Now tell the new camera we are using him. _camera_node->add_display_region(this); } } - _qpcamera = camera; + _camera = camera; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index a42478d047..7a24d06196 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -21,7 +21,7 @@ #include "pandabase.h" #include "referenceCount.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "cullResult.h" #include "pointerTo.h" @@ -32,7 +32,7 @@ class GraphicsChannel; class GraphicsWindow; class GraphicsPipe; class CullHandler; -class qpCamera; +class Camera; //////////////////////////////////////////////////////////////////// // Class : DisplayRegion @@ -65,8 +65,8 @@ PUBLISHED: GraphicsWindow *get_window() const; GraphicsPipe *get_pipe() const; - void set_qpcamera(const qpNodePath &camera); - INLINE const qpNodePath &get_qpcamera() const; + void set_camera(const NodePath &camera); + INLINE const NodePath &get_camera() const; INLINE void set_active(bool active); INLINE bool is_active() const; @@ -96,8 +96,8 @@ protected: int _pt; GraphicsLayer *_layer; - qpNodePath _qpcamera; - qpCamera *_camera_node; + NodePath _camera; + Camera *_camera_node; bool _active; diff --git a/panda/src/display/geomNodeContext.I b/panda/src/display/geomNodeContext.I index dd4703f1d2..ab10ebd808 100644 --- a/panda/src/display/geomNodeContext.I +++ b/panda/src/display/geomNodeContext.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE GeomNodeContext:: -GeomNodeContext(qpGeomNode *node) : +GeomNodeContext(GeomNode *node) : _node(node) { } diff --git a/panda/src/display/geomNodeContext.h b/panda/src/display/geomNodeContext.h index d7842ee9cc..b3a6e1869e 100644 --- a/panda/src/display/geomNodeContext.h +++ b/panda/src/display/geomNodeContext.h @@ -23,7 +23,7 @@ #include "savedContext.h" -class qpGeomNode; +class GeomNode; //////////////////////////////////////////////////////////////////// // Class : GeomNodeContext @@ -44,12 +44,12 @@ class qpGeomNode; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA GeomNodeContext : public SavedContext { public: - INLINE GeomNodeContext(qpGeomNode *node); + INLINE GeomNodeContext(GeomNode *node); // This cannot be a PT(GeomNode), because the geomNode and the GSG // both own their GeomNodeContexts! That would create a circular // reference count. - qpGeomNode *_node; + GeomNode *_node; public: static TypeHandle get_class_type() { diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index c02f82b4f5..5eaaabddaf 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -22,7 +22,7 @@ #include "drawCullHandler.h" #include "binCullHandler.h" #include "cullResult.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "clockObject.h" #include "pStatTimer.h" #include "pStatClient.h" @@ -138,7 +138,7 @@ cull_and_draw_together(GraphicsWindow *win, DisplayRegion *dr) { GraphicsStateGuardian *gsg = win->get_gsg(); nassertv(gsg != (GraphicsStateGuardian *)NULL); - PT(SceneSetup) scene_setup = setup_scene(dr->get_qpcamera(), gsg); + PT(SceneSetup) scene_setup = setup_scene(dr->get_camera(), gsg); if (setup_gsg(gsg, scene_setup)) { DisplayRegionStack old_dr = gsg->push_display_region(dr); gsg->prepare_display_region(); @@ -194,7 +194,7 @@ cull_bin_draw(GraphicsWindow *win, DisplayRegion *dr) { cull_result = new CullResult(gsg); } - PT(SceneSetup) scene_setup = setup_scene(dr->get_qpcamera(), gsg); + PT(SceneSetup) scene_setup = setup_scene(dr->get_camera(), gsg); if (scene_setup != (SceneSetup *)NULL) { BinCullHandler cull_handler(cull_result); do_cull(&cull_handler, scene_setup, gsg); @@ -218,13 +218,13 @@ cull_bin_draw(GraphicsWindow *win, DisplayRegion *dr) { // reason. //////////////////////////////////////////////////////////////////// PT(SceneSetup) GraphicsEngine:: -setup_scene(const qpNodePath &camera, GraphicsStateGuardian *gsg) { +setup_scene(const NodePath &camera, GraphicsStateGuardian *gsg) { if (camera.is_empty()) { // No camera, no draw. return NULL; } - qpCamera *camera_node; + Camera *camera_node; DCAST_INTO_R(camera_node, camera.node(), NULL); if (!camera_node->is_active()) { @@ -238,7 +238,7 @@ setup_scene(const qpNodePath &camera, GraphicsStateGuardian *gsg) { return NULL; } - qpNodePath scene_root = camera_node->get_scene(); + NodePath scene_root = camera_node->get_scene(); if (scene_root.is_empty()) { // No scene, no draw. return NULL; @@ -288,13 +288,13 @@ do_cull(CullHandler *cull_handler, SceneSetup *scene_setup, // Statistics PStatTimer timer(_cull_pcollector); - qpCullTraverser trav; + CullTraverser trav; trav.set_cull_handler(cull_handler); trav.set_depth_offset_decals(gsg->depth_offset_decals()); trav.set_scene(scene_setup); trav.set_camera_mask(scene_setup->get_camera_node()->get_camera_mask()); - if (qpview_frustum_cull) { + if (view_frustum_cull) { // If we're to be performing view-frustum culling, determine the // bounding volume associated with the current viewing frustum. diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index bedb9f9212..f7de6bc8d5 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -59,7 +59,7 @@ private: void cull_bin_draw(); void cull_bin_draw(GraphicsWindow *win, DisplayRegion *dr); - PT(SceneSetup) setup_scene(const qpNodePath &camera, + PT(SceneSetup) setup_scene(const NodePath &camera, GraphicsStateGuardian *gsg); void do_cull(CullHandler *cull_handler, SceneSetup *scene_setup, GraphicsStateGuardian *gsg); diff --git a/panda/src/display/graphicsStateGuardian.I b/panda/src/display/graphicsStateGuardian.I index 4e24bd4760..8d858e6bb2 100644 --- a/panda/src/display/graphicsStateGuardian.I +++ b/panda/src/display/graphicsStateGuardian.I @@ -74,7 +74,7 @@ get_scene() const { //////////////////////////////////////////////////////////////////// INLINE void GraphicsStateGuardian:: modify_state(const RenderState *state) { - _qpstate = _qpstate->issue_delta_modify(state, this); + _state = _state->issue_delta_modify(state, this); } //////////////////////////////////////////////////////////////////// @@ -91,7 +91,7 @@ modify_state(const RenderState *state) { //////////////////////////////////////////////////////////////////// INLINE void GraphicsStateGuardian:: set_state(const RenderState *state) { - _qpstate = _qpstate->issue_delta_set(state, this); + _state = _state->issue_delta_set(state, this); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index d706208f56..512e03c100 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -133,7 +133,7 @@ reset() { _frame_buffer_stack_level = 0; _lens_stack_level = 0; - _qpstate = RenderState::make_empty(); + _state = RenderState::make_empty(); _transform = TransformState::make_identity(); _buffer_mask = 0; @@ -342,7 +342,7 @@ release_texture(TextureContext *) { // contents of the node. //////////////////////////////////////////////////////////////////// GeomNodeContext *GraphicsStateGuardian:: -prepare_geom_node(qpGeomNode *) { +prepare_geom_node(GeomNode *) { return (GeomNodeContext *)NULL; } @@ -353,7 +353,7 @@ prepare_geom_node(qpGeomNode *) { // prepare_geom_node(). //////////////////////////////////////////////////////////////////// void GraphicsStateGuardian:: -draw_geom_node(qpGeomNode *node, const RenderState *state, +draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *) { #if 0 // temporarily disabled until ported to new scene graph int num_geoms = node->get_num_geoms(); diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 43bd54fca3..3463384863 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -92,8 +92,8 @@ public: virtual void apply_texture(TextureContext *tc); virtual void release_texture(TextureContext *tc); - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node); - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node); + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc); virtual void release_geom_node(GeomNodeContext *gnc); @@ -217,7 +217,7 @@ protected: protected: PT(SceneSetup) _scene_setup; - CPT(RenderState) _qpstate; + CPT(RenderState) _state; CPT(TransformState) _transform; int _buffer_mask; diff --git a/panda/src/distort/nonlinearImager.I b/panda/src/distort/nonlinearImager.I index a7f8a8b813..bf4633b980 100644 --- a/panda/src/distort/nonlinearImager.I +++ b/panda/src/distort/nonlinearImager.I @@ -26,7 +26,7 @@ // establish a relative coordinate system with them. //////////////////////////////////////////////////////////////////// INLINE void NonlinearImager:: -set_camera(qpLensNode *camera) { +set_camera(LensNode *camera) { _camera = camera; _stale = true; } @@ -37,7 +37,7 @@ set_camera(qpLensNode *camera) { // Description: Returns the virtual camera that will be used to // view the various ProjectionScreens. //////////////////////////////////////////////////////////////////// -INLINE qpLensNode *NonlinearImager:: +INLINE LensNode *NonlinearImager:: get_camera() const { return _camera; } @@ -49,7 +49,7 @@ get_camera() const { // scene graph, which is used to render all of the // screen meshes. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath NonlinearImager:: +INLINE NodePath NonlinearImager:: get_internal_scene() const { return _internal_scene; } diff --git a/panda/src/distort/nonlinearImager.cxx b/panda/src/distort/nonlinearImager.cxx index fab92b4f26..3f441e710e 100644 --- a/panda/src/distort/nonlinearImager.cxx +++ b/panda/src/distort/nonlinearImager.cxx @@ -37,14 +37,14 @@ NonlinearImager:: NonlinearImager(DisplayRegion *dr) { _dr = dr; - _internal_camera = new qpCamera("NonlinearImager"); + _internal_camera = new Camera("NonlinearImager"); _internal_camera->set_lens(new MatrixLens); _internal_scene_node = new PandaNode("screens"); - _internal_scene = qpNodePath(_internal_scene_node); + _internal_scene = NodePath(_internal_scene_node); _internal_camera->set_scene(_internal_scene); - qpNodePath camera_np = _internal_scene.attach_new_node(_internal_camera); - _dr->set_qpcamera(camera_np); + NodePath camera_np = _internal_scene.attach_new_node(_internal_camera); + _dr->set_camera(camera_np); // Enable face culling on the wireframe mesh. This will help us to // cull out invalid polygons that result from vertices crossing a @@ -61,8 +61,8 @@ NonlinearImager(DisplayRegion *dr) { //////////////////////////////////////////////////////////////////// NonlinearImager:: ~NonlinearImager() { - _internal_camera->set_scene(qpNodePath()); - _dr->set_qpcamera(qpNodePath()); + _internal_camera->set_scene(NodePath()); + _dr->set_camera(NodePath()); remove_all_screens(); } @@ -105,9 +105,9 @@ add_screen(ProjectionScreen *screen) { // If the LensNode associated with the ProjectionScreen is an actual // Camera, then it has a scene associated. Otherwise, the user will // have to specify the scene later. - qpLensNode *projector = screen->get_projector(); - if (projector->is_of_type(qpCamera::get_class_type())) { - qpCamera *camera = DCAST(qpCamera, projector); + LensNode *projector = screen->get_projector(); + if (projector->is_of_type(Camera::get_class_type())) { + Camera *camera = DCAST(Camera, projector); new_screen._scene = camera->get_scene(); } @@ -212,7 +212,7 @@ set_size(int index, int width, int height) { // screen. //////////////////////////////////////////////////////////////////// void NonlinearImager:: -set_source(int index, qpLensNode *source, const qpNodePath &scene) { +set_source(int index, LensNode *source, const NodePath &scene) { nassertv(index >= 0 && index < (int)_screens.size()); _screens[index]._source = source; _screens[index]._scene = scene; @@ -230,7 +230,7 @@ set_source(int index, qpLensNode *source, const qpNodePath &scene) { // Camera itself. //////////////////////////////////////////////////////////////////// void NonlinearImager:: -set_source(int index, qpCamera *source) { +set_source(int index, Camera *source) { nassertv(index >= 0 && index < (int)_screens.size()); _screens[index]._source = source; _screens[index]._scene = source->get_scene(); @@ -284,7 +284,7 @@ recompute() { } } - if (_camera != (qpLensNode *)NULL && _camera->get_lens() != (Lens *)NULL) { + if (_camera != (LensNode *)NULL && _camera->get_lens() != (Lens *)NULL) { _camera_lens_change = _camera->get_lens()->get_last_change(); } _stale = false; @@ -319,7 +319,7 @@ render() { //////////////////////////////////////////////////////////////////// void NonlinearImager:: recompute_if_stale() { - if (_camera != (qpLensNode *)NULL && + if (_camera != (LensNode *)NULL && _camera->get_lens() != (Lens *)NULL) { UpdateSeq lens_change = _camera->get_lens()->get_last_change(); if (_stale || lens_change != _camera_lens_change) { @@ -349,7 +349,7 @@ void NonlinearImager:: recompute_screen(NonlinearImager::Screen &screen) { screen._mesh.remove_node(); screen._texture.clear(); - if (_camera == (qpLensNode *)NULL || !screen._active) { + if (_camera == (LensNode *)NULL || !screen._active) { // Not much we can do without a camera. return; } @@ -378,7 +378,7 @@ recompute_screen(NonlinearImager::Screen &screen) { //////////////////////////////////////////////////////////////////// void NonlinearImager:: render_screen(NonlinearImager::Screen &screen) { - if (screen._source == (qpLensNode *)NULL) { + if (screen._source == (LensNode *)NULL) { distort_cat.error() << "No source lens specified for screen " << screen._screen->get_name() << "\n"; diff --git a/panda/src/distort/nonlinearImager.h b/panda/src/distort/nonlinearImager.h index dce63f65f8..e2279a7e74 100644 --- a/panda/src/distort/nonlinearImager.h +++ b/panda/src/distort/nonlinearImager.h @@ -23,10 +23,10 @@ #include "projectionScreen.h" #include "displayRegion.h" -#include "qpcamera.h" +#include "camera.h" #include "texture.h" #include "pandaNode.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "pointerTo.h" #include "pvector.h" @@ -61,16 +61,16 @@ PUBLISHED: int get_num_screens() const; ProjectionScreen *get_screen(int index) const; void set_size(int index, int width, int height); - void set_source(int index, qpLensNode *source, const qpNodePath &scene); - void set_source(int index, qpCamera *source); + void set_source(int index, LensNode *source, const NodePath &scene); + void set_source(int index, Camera *source); void set_active(int index, bool active); bool get_active(int index) const; - INLINE void set_camera(qpLensNode *camera); - INLINE qpLensNode *get_camera() const; + INLINE void set_camera(LensNode *camera); + INLINE LensNode *get_camera() const; - INLINE qpNodePath get_internal_scene() const; + INLINE NodePath get_internal_scene() const; void recompute(); void render(); @@ -79,10 +79,10 @@ private: class Screen { public: PT(ProjectionScreen) _screen; - qpNodePath _mesh; + NodePath _mesh; PT(Texture) _texture; - PT(qpLensNode) _source; - qpNodePath _scene; + PT(LensNode) _source; + NodePath _scene; int _tex_width, _tex_height; UpdateSeq _last_screen; bool _active; @@ -97,10 +97,10 @@ private: typedef pvector Screens; Screens _screens; - PT(qpLensNode) _camera; + PT(LensNode) _camera; - PT(qpCamera) _internal_camera; - qpNodePath _internal_scene; + PT(Camera) _internal_camera; + NodePath _internal_scene; PT(PandaNode) _internal_scene_node; bool _stale; diff --git a/panda/src/distort/projectionScreen.I b/panda/src/distort/projectionScreen.I index 228173ddc5..f2366d79bb 100644 --- a/panda/src/distort/projectionScreen.I +++ b/panda/src/distort/projectionScreen.I @@ -28,7 +28,7 @@ // geometry within the ProjectionScreen. //////////////////////////////////////////////////////////////////// INLINE void ProjectionScreen:: -set_projector(qpLensNode *projector) { +set_projector(LensNode *projector) { _projector = projector; _stale = true; } @@ -41,7 +41,7 @@ set_projector(qpLensNode *projector) { // projector for this screen, or NULL if no LensNode is // associated. //////////////////////////////////////////////////////////////////// -INLINE qpLensNode *ProjectionScreen:: +INLINE LensNode *ProjectionScreen:: get_projector() const { return _projector; } diff --git a/panda/src/distort/projectionScreen.cxx b/panda/src/distort/projectionScreen.cxx index 9f00cf3ca7..20aeffd318 100644 --- a/panda/src/distort/projectionScreen.cxx +++ b/panda/src/distort/projectionScreen.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "projectionScreen.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geom.h" #include "geomTristrip.h" #include "transformState.h" @@ -111,16 +111,16 @@ app_traverse(const ArcChain &) { // respectively; distance represents the approximate // distance of the screen from the lens center. //////////////////////////////////////////////////////////////////// -PT(qpGeomNode) ProjectionScreen:: -generate_screen(qpLensNode *projector, const string &screen_name, +PT(GeomNode) ProjectionScreen:: +generate_screen(LensNode *projector, const string &screen_name, int num_x_verts, int num_y_verts, float distance) { - nassertr(projector != (qpLensNode *)NULL, NULL); + nassertr(projector != (LensNode *)NULL, NULL); nassertr(projector->get_lens() != NULL, NULL); // First, get the relative coordinate space of the projector. LMatrix4f rel_mat; - qpNodePath projector_np(projector); - qpNodePath this_np(this); + NodePath projector_np(projector); + NodePath this_np(this); rel_mat = projector_np.get_mat(this_np); // Now compute all the vertices for the screen. These are arranged @@ -192,7 +192,7 @@ generate_screen(qpLensNode *projector, const string &screen_name, geom->set_colors(colors, G_OVERALL); // Now create a GeomNode to hold this mesh. - PT(qpGeomNode) geom_node = new qpGeomNode(screen_name); + PT(GeomNode) geom_node = new GeomNode(screen_name); geom_node->add_geom(geom); _stale = true; @@ -208,13 +208,13 @@ generate_screen(qpLensNode *projector, const string &screen_name, // generate_screen(). //////////////////////////////////////////////////////////////////// void ProjectionScreen:: -regenerate_screen(qpLensNode *projector, const string &screen_name, +regenerate_screen(LensNode *projector, const string &screen_name, int num_x_verts, int num_y_verts, float distance) { // First, remove all existing children. remove_all_children(); // And attach a new child. - PT(qpGeomNode) geom_node = + PT(GeomNode) geom_node = generate_screen(projector, screen_name, num_x_verts, num_y_verts, distance); add_child(geom_node); @@ -240,8 +240,8 @@ regenerate_screen(qpLensNode *projector, const string &screen_name, // it does not get dereferenced and deleted. //////////////////////////////////////////////////////////////////// PT(PandaNode) ProjectionScreen:: -make_flat_mesh(qpLensNode *camera) { - nassertr(camera != (qpLensNode *)NULL, NULL); +make_flat_mesh(LensNode *camera) { + nassertr(camera != (LensNode *)NULL, NULL); nassertr(camera->get_lens() != (Lens *)NULL, NULL); // First, ensure the UV's are up-to-date. @@ -271,7 +271,7 @@ make_flat_mesh(qpLensNode *camera) { //////////////////////////////////////////////////////////////////// void ProjectionScreen:: recompute() { - if (_projector != (qpLensNode *)NULL && + if (_projector != (LensNode *)NULL && _projector->get_lens() != (Lens *)NULL) { _colors.clear(); _colors.push_back(_vignette_color); @@ -296,7 +296,7 @@ recompute() { //////////////////////////////////////////////////////////////////// void ProjectionScreen:: recompute_if_stale() { - if (_projector != (qpLensNode *)NULL && + if (_projector != (LensNode *)NULL && _projector->get_lens() != (Lens *)NULL) { UpdateSeq lens_change = _projector->get_lens()->get_last_change(); if (_stale || lens_change != _projector_lens_change) { @@ -304,8 +304,8 @@ recompute_if_stale() { } else { // Get the relative transform to ensure it hasn't changed. - qpNodePath this_np(this); - qpNodePath projector_np(_projector); + NodePath this_np(this); + NodePath projector_np(_projector); const LMatrix4f &top_mat = this_np.get_mat(projector_np); if (!_rel_top_mat.almost_equal(top_mat)) { _rel_top_mat = top_mat; @@ -327,7 +327,7 @@ recompute_if_stale() { void ProjectionScreen:: recompute_node(PandaNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat) { if (node->is_geom_node()) { - recompute_geom_node(DCAST(qpGeomNode, node), rel_mat, computed_rel_mat); + recompute_geom_node(DCAST(GeomNode, node), rel_mat, computed_rel_mat); } // Now recurse on children. @@ -358,12 +358,12 @@ recompute_node(PandaNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat) { // Description: Recomputes the UV's just for the indicated GeomNode. //////////////////////////////////////////////////////////////////// void ProjectionScreen:: -recompute_geom_node(qpGeomNode *node, LMatrix4f &rel_mat, +recompute_geom_node(GeomNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat) { if (!computed_rel_mat) { // All right, time to compute the matrix. - qpNodePath node_np(node); - qpNodePath projector_np(_projector); + NodePath node_np(node); + NodePath projector_np(_projector); rel_mat = node_np.get_mat(projector_np); computed_rel_mat = true; } @@ -432,7 +432,7 @@ recompute_geom(Geom *geom, const LMatrix4f &rel_mat) { // created, arc, or NULL if no arc was created. //////////////////////////////////////////////////////////////////// PandaNode *ProjectionScreen:: -make_mesh_node(PandaNode *result_parent, PandaNode *node, qpLensNode *camera, +make_mesh_node(PandaNode *result_parent, PandaNode *node, LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat) { if (!node->safe_to_flatten()) { // If we can't safely flatten this node, ignore it (and all of its @@ -443,7 +443,7 @@ make_mesh_node(PandaNode *result_parent, PandaNode *node, qpLensNode *camera, PT(PandaNode) new_node; if (node->is_geom_node()) { new_node = - make_mesh_geom_node(DCAST(qpGeomNode, node), camera, + make_mesh_geom_node(DCAST(GeomNode, node), camera, rel_mat, computed_rel_mat); } else { new_node = node->make_copy(); @@ -462,7 +462,7 @@ make_mesh_node(PandaNode *result_parent, PandaNode *node, qpLensNode *camera, // node, calling make_mesh_node() on each one. //////////////////////////////////////////////////////////////////// void ProjectionScreen:: -make_mesh_children(PandaNode *new_node, PandaNode *node, qpLensNode *camera, +make_mesh_children(PandaNode *new_node, PandaNode *node, LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat) { int num_children = node->get_num_children(); for (int i = 0; i < num_children; i++) { @@ -498,15 +498,15 @@ make_mesh_children(PandaNode *new_node, PandaNode *node, qpLensNode *camera, // flattened into two dimensions as seen by the // indicated camera. //////////////////////////////////////////////////////////////////// -PT(qpGeomNode) ProjectionScreen:: -make_mesh_geom_node(qpGeomNode *node, qpLensNode *camera, +PT(GeomNode) ProjectionScreen:: +make_mesh_geom_node(GeomNode *node, LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat) { - PT(qpGeomNode) new_node = new qpGeomNode(node->get_name()); + PT(GeomNode) new_node = new GeomNode(node->get_name()); if (!computed_rel_mat) { // All right, time to compute the matrix. - qpNodePath node_np(node); - qpNodePath camera_np(camera); + NodePath node_np(node); + NodePath camera_np(camera); rel_mat = node_np.get_mat(camera_np); computed_rel_mat = true; } diff --git a/panda/src/distort/projectionScreen.h b/panda/src/distort/projectionScreen.h index 7c2cd0445c..aff9bce9be 100644 --- a/panda/src/distort/projectionScreen.h +++ b/panda/src/distort/projectionScreen.h @@ -22,8 +22,8 @@ #include "pandabase.h" #include "pandaNode.h" -#include "qplensNode.h" -#include "qpgeomNode.h" +#include "lensNode.h" +#include "geomNode.h" class Geom; @@ -55,16 +55,16 @@ protected: virtual PandaNode *make_copy() const; PUBLISHED: - INLINE void set_projector(qpLensNode *projector); - INLINE qpLensNode *get_projector() const; + INLINE void set_projector(LensNode *projector); + INLINE LensNode *get_projector() const; - PT(qpGeomNode) generate_screen(qpLensNode *projector, + PT(GeomNode) generate_screen(LensNode *projector, const string &screen_name, int num_x_verts, int num_y_verts, float distance); - void regenerate_screen(qpLensNode *projector, const string &screen_name, + void regenerate_screen(LensNode *projector, const string &screen_name, int num_x_verts, int num_y_verts, float distance); - PT(PandaNode) make_flat_mesh(qpLensNode *camera); + PT(PandaNode) make_flat_mesh(LensNode *camera); INLINE void set_vignette_on(bool vignette_on); INLINE bool get_vignette_on() const; @@ -82,21 +82,21 @@ public: private: void recompute_if_stale(); void recompute_node(PandaNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat); - void recompute_geom_node(qpGeomNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat); + void recompute_geom_node(GeomNode *node, LMatrix4f &rel_mat, bool &computed_rel_mat); void recompute_geom(Geom *geom, const LMatrix4f &rel_mat); PandaNode * - make_mesh_node(PandaNode *result_parent, PandaNode *node, qpLensNode *camera, + make_mesh_node(PandaNode *result_parent, PandaNode *node, LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat); void make_mesh_children(PandaNode *new_node, PandaNode *node, - qpLensNode *camera, + LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat); - PT(qpGeomNode) make_mesh_geom_node(qpGeomNode *node, qpLensNode *camera, + PT(GeomNode) make_mesh_geom_node(GeomNode *node, LensNode *camera, LMatrix4f &rel_mat, bool &computed_rel_mat); PT(Geom) make_mesh_geom(Geom *geom, Lens *lens, LMatrix4f &rel_mat); - PT(qpLensNode) _projector; + PT(LensNode) _projector; bool _vignette_on; Colorf _vignette_color; Colorf _frame_color; diff --git a/panda/src/dxgsg/dxGeomNodeContext.I b/panda/src/dxgsg/dxGeomNodeContext.I index dc8f11889f..8d30be3c3b 100644 --- a/panda/src/dxgsg/dxGeomNodeContext.I +++ b/panda/src/dxgsg/dxGeomNodeContext.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE DXGeomNodeContext:: -DXGeomNodeContext(qpGeomNode *node) : GeomNodeContext(node) +DXGeomNodeContext(GeomNode *node) : GeomNodeContext(node) { _num_verts = 0; _pVB = NULL; diff --git a/panda/src/dxgsg/dxGeomNodeContext.h b/panda/src/dxgsg/dxGeomNodeContext.h index 0550a31b4e..0e4d7b9481 100644 --- a/panda/src/dxgsg/dxGeomNodeContext.h +++ b/panda/src/dxgsg/dxGeomNodeContext.h @@ -22,7 +22,7 @@ #include "dxgsgbase.h" #include "geomNodeContext.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "pvector.h" typedef struct { @@ -36,7 +36,7 @@ typedef struct { //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX DXGeomNodeContext : public GeomNodeContext { public: - INLINE DXGeomNodeContext(qpGeomNode *node); + INLINE DXGeomNodeContext(GeomNode *node); ~DXGeomNodeContext(); // A list of the dynamic Geoms within the GeomNode; these aren't diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index 5df948097e..16f05e34a9 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx @@ -44,7 +44,7 @@ #include "renderModeAttrib.h" #include "fogAttrib.h" #include "depthOffsetAttrib.h" -#include "qpfog.h" +#include "fog.h" #ifdef DO_PSTATS #include "pStatTimer.h" @@ -2013,7 +2013,7 @@ draw_sprite(GeomSprite *geom, GeomContext *gc) { if (!geom->get_alpha_disable()) { // figure out if alpha's enabled (if not, no reason to sort) - const TransparencyAttrib *trans = _qpstate->get_transparency(); + const TransparencyAttrib *trans = _state->get_transparency(); if (trans != (const TransparencyAttrib *)NULL) { alpha = (trans->get_mode() != TransparencyAttrib::M_none); } @@ -3883,11 +3883,11 @@ void DXGraphicsStateGuardian::apply_material( const Material* material ) { // Description: //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian:: -apply_fog(qpFog *fog) { +apply_fog(Fog *fog) { if(_doFogType==None) return; - qpFog::Mode panda_fogmode = fog->get_mode(); + Fog::Mode panda_fogmode = fog->get_mode(); D3DFOGMODE d3dfogmode = get_fog_mode_type(panda_fogmode); @@ -3902,7 +3902,7 @@ apply_fog(qpFog *fog) { // if not WFOG, then docs say we need to adjust values to range [0,1] switch (panda_fogmode) { - case qpFog::M_linear: + case Fog::M_linear: { float onset, opaque; fog->get_linear_range(onset, opaque); @@ -3913,8 +3913,8 @@ apply_fog(qpFog *fog) { *((LPDWORD) (&opaque)) ); } break; - case qpFog::M_exponential: - case qpFog::M_exponential_squared: + case Fog::M_exponential: + case Fog::M_exponential_squared: { // Exponential fog is always camera-relative. float fog_density = fog->get_exp_density(); @@ -4192,8 +4192,8 @@ void DXGraphicsStateGuardian:: issue_fog(const FogAttrib *attrib) { if (!attrib->is_off()) { enable_fog(true); - qpFog *fog = attrib->get_fog(); - nassertv(fog != (qpFog *)NULL); + Fog *fog = attrib->get_fog(); + nassertv(fog != (Fog *)NULL); apply_fog(fog); } else { enable_fog(false); @@ -4224,7 +4224,7 @@ bind_light(PointLight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LPoint3f pos = light->get_point() * rel_mat; @@ -4265,7 +4265,7 @@ bind_light(DirectionalLight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LVector3f dir = light->get_direction() * rel_mat; @@ -4309,7 +4309,7 @@ bind_light(Spotlight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LPoint3f pos = lens->get_nodal_point() * rel_mat; @@ -4821,13 +4821,13 @@ get_depth_func_type(DepthTestAttrib::Mode m) const { // Description: Maps from the fog types to gl version //////////////////////////////////////////////////////////////////// INLINE D3DFOGMODE DXGraphicsStateGuardian:: -get_fog_mode_type(qpFog::Mode m) const { +get_fog_mode_type(Fog::Mode m) const { switch (m) { - case qpFog::M_linear: + case Fog::M_linear: return D3DFOG_LINEAR; - case qpFog::M_exponential: + case Fog::M_exponential: return D3DFOG_EXP; - case qpFog::M_exponential_squared: + case Fog::M_exponential_squared: return D3DFOG_EXP2; } dxgsg_cat.error() << "Invalid Fog::Mode value" << endl; @@ -5740,7 +5740,7 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DVECTOR& vFrom, D3DVECTOR& vAt, // contents of the node. //////////////////////////////////////////////////////////////////// GeomNodeContext *DXGraphicsStateGuardian:: -prepare_geom_node(qpGeomNode *node) { +prepare_geom_node(GeomNode *node) { #if 0 // temporarily disabled until ported to new scene graph if(link_tristrips) { for(int iGeom=0;iGeomget_num_geoms();iGeom++) { @@ -6205,7 +6205,7 @@ prepare_geom_node(qpGeomNode *node) { // prepare_geom_node(). //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian:: -draw_geom_node(qpGeomNode *node, const RenderState *state, GeomNodeContext *gnc) { +draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) { #if 0 // temporarily disabled until ported to new scene graph uint i,num_geoms = node->get_num_geoms(); diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.h b/panda/src/dxgsg/dxGraphicsStateGuardian.h index 561d172e2f..c097089e1b 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.h +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.h @@ -32,7 +32,7 @@ #include "depthTestAttrib.h" #include "renderModeAttrib.h" #include "textureApplyAttrib.h" -#include "qpfog.h" +#include "fog.h" #include "pointerToArray.h" class Light; @@ -86,8 +86,8 @@ public: virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc); virtual void draw_sphere(GeomSphere *geom, GeomContext *gc); - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node); - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node); + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc); virtual void release_geom_node(GeomNodeContext *gnc); @@ -108,7 +108,7 @@ public: const RenderBuffer &rb); virtual void apply_material(const Material *material); - virtual void apply_fog(qpFog *fog); + virtual void apply_fog(Fog *fog); virtual void issue_transform(const TransformState *transform); virtual void issue_tex_matrix(const TexMatrixAttrib *attrib); @@ -206,7 +206,7 @@ protected: INLINE D3DTEXTUREADDRESS get_texture_wrap_mode(Texture::WrapMode wm) const; INLINE D3DCMPFUNC get_depth_func_type(DepthTestAttrib::Mode m) const; - INLINE D3DFOGMODE get_fog_mode_type(qpFog::Mode m) const; + INLINE D3DFOGMODE get_fog_mode_type(Fog::Mode m) const; INLINE void enable_primitive_clipping(bool val); INLINE void enable_alpha_test(bool val); diff --git a/panda/src/dxgsg8/dxGeomNodeContext8.I b/panda/src/dxgsg8/dxGeomNodeContext8.I index ab092a9755..739d1d127a 100644 --- a/panda/src/dxgsg8/dxGeomNodeContext8.I +++ b/panda/src/dxgsg8/dxGeomNodeContext8.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE DXGeomNodeContext:: -DXGeomNodeContext(qpGeomNode *node) : GeomNodeContext(node) +DXGeomNodeContext(GeomNode *node) : GeomNodeContext(node) { _num_verts = 0; /* diff --git a/panda/src/dxgsg8/dxGeomNodeContext8.h b/panda/src/dxgsg8/dxGeomNodeContext8.h index 9a8ad16564..8a30204793 100644 --- a/panda/src/dxgsg8/dxGeomNodeContext8.h +++ b/panda/src/dxgsg8/dxGeomNodeContext8.h @@ -22,7 +22,7 @@ #include "dxgsg8base.h" #include "geomNodeContext.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "pvector.h" typedef struct { @@ -38,7 +38,7 @@ typedef struct { //////////////////////////////////////////////////////////////////// class EXPCL_PANDADX DXGeomNodeContext : public GeomNodeContext { public: - INLINE DXGeomNodeContext(qpGeomNode *node); + INLINE DXGeomNodeContext(GeomNode *node); ~DXGeomNodeContext(); // A list of the dynamic Geoms within the GeomNode; these aren't diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 9488dbf0bd..c297252843 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -45,7 +45,7 @@ #include "renderModeAttrib.h" #include "fogAttrib.h" #include "depthOffsetAttrib.h" -#include "qpfog.h" +#include "fog.h" #ifdef DO_PSTATS #include "pStatTimer.h" @@ -1759,7 +1759,7 @@ draw_sprite(GeomSprite *geom, GeomContext *gc) { if (!geom->get_alpha_disable()) { // figure out if alpha's enabled (if not, no reason to sort) - const TransparencyAttrib *trans = _qpstate->get_transparency(); + const TransparencyAttrib *trans = _state->get_transparency(); if (trans != (const TransparencyAttrib *)NULL) { alpha = (trans->get_mode() != TransparencyAttrib::M_none); } @@ -3183,12 +3183,12 @@ void DXGraphicsStateGuardian::apply_material( const Material* material ) { // Description: //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian:: -apply_fog(qpFog *fog) { +apply_fog(Fog *fog) { if(_doFogType==None) return; - qpFog::Mode panda_fogmode = fog->get_mode(); + Fog::Mode panda_fogmode = fog->get_mode(); D3DFOGMODE d3dfogmode = get_fog_mode_type(panda_fogmode); @@ -3203,7 +3203,7 @@ apply_fog(qpFog *fog) { // if not WFOG, then docs say we need to adjust values to range [0,1] switch (panda_fogmode) { - case qpFog::M_linear: + case Fog::M_linear: { float onset, opaque; fog->get_linear_range(onset, opaque); @@ -3214,8 +3214,8 @@ apply_fog(qpFog *fog) { *((LPDWORD) (&opaque)) ); } break; - case qpFog::M_exponential: - case qpFog::M_exponential_squared: + case Fog::M_exponential: + case Fog::M_exponential_squared: { // Exponential fog is always camera-relative. float fog_density = fog->get_exp_density(); @@ -3493,8 +3493,8 @@ void DXGraphicsStateGuardian:: issue_fog(const FogAttrib *attrib) { if (!attrib->is_off()) { enable_fog(true); - qpFog *fog = attrib->get_fog(); - nassertv(fog != (qpFog *)NULL); + Fog *fog = attrib->get_fog(); + nassertv(fog != (Fog *)NULL); apply_fog(fog); } else { enable_fog(false); @@ -3525,7 +3525,7 @@ bind_light(PointLight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LPoint3f pos = light->get_point() * rel_mat; @@ -3566,7 +3566,7 @@ bind_light(DirectionalLight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LVector3f dir = light->get_direction() * rel_mat; @@ -3610,7 +3610,7 @@ bind_light(Spotlight *light, int light_id) { // Get the light in "world coordinates". This means the light in // the coordinate space of the camera, converted to DX's coordinate // system. - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_camera_path()); LMatrix4f rel_mat = light_mat * LMatrix4f::convert_mat(CS_yup_left, CS_default); LPoint3f pos = lens->get_nodal_point() * rel_mat; @@ -3990,13 +3990,13 @@ get_depth_func_type(DepthTestAttrib::Mode m) const { // Description: Maps from the fog types to gl version //////////////////////////////////////////////////////////////////// INLINE D3DFOGMODE DXGraphicsStateGuardian:: -get_fog_mode_type(qpFog::Mode m) const { +get_fog_mode_type(Fog::Mode m) const { switch (m) { - case qpFog::M_linear: + case Fog::M_linear: return D3DFOG_LINEAR; - case qpFog::M_exponential: + case Fog::M_exponential: return D3DFOG_EXP; - case qpFog::M_exponential_squared: + case Fog::M_exponential_squared: return D3DFOG_EXP2; } dxgsg_cat.error() << "Invalid Fog::Mode value" << endl; @@ -4758,7 +4758,7 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DXVECTOR3& vFrom, D3DXVECTOR3& vAt, // contents of the node. //////////////////////////////////////////////////////////////////// GeomNodeContext *DXGraphicsStateGuardian:: -prepare_geom_node(qpGeomNode *node) { +prepare_geom_node(GeomNode *node) { dxgsg_cat.error() << "prepare_geom_node unimplemented for DX8!\n"; return NULL; } @@ -4770,7 +4770,7 @@ prepare_geom_node(qpGeomNode *node) { // prepare_geom_node(). //////////////////////////////////////////////////////////////////// void DXGraphicsStateGuardian:: -draw_geom_node(qpGeomNode *node, const RenderState *state, +draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) { return; // unimplemented } diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h index aef54077fd..9db0c55c31 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h @@ -35,7 +35,7 @@ #include "depthTestAttrib.h" #include "renderModeAttrib.h" #include "textureApplyAttrib.h" -#include "qpfog.h" +#include "fog.h" #include "pointerToArray.h" class Light; @@ -91,8 +91,8 @@ public: virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc); virtual void draw_sphere(GeomSphere *geom, GeomContext *gc); - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node); - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node); + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc); virtual void release_geom_node(GeomNodeContext *gnc); @@ -113,7 +113,7 @@ public: const RenderBuffer &rb); virtual void apply_material(const Material *material); - virtual void apply_fog(qpFog *fog); + virtual void apply_fog(Fog *fog); virtual void issue_transform(const TransformState *transform); virtual void issue_tex_matrix(const TexMatrixAttrib *attrib); @@ -202,7 +202,7 @@ protected: INLINE D3DTEXTUREADDRESS get_texture_wrap_mode(Texture::WrapMode wm) const; INLINE D3DCMPFUNC get_depth_func_type(DepthTestAttrib::Mode m) const; - INLINE D3DFOGMODE get_fog_mode_type(qpFog::Mode m) const; + INLINE D3DFOGMODE get_fog_mode_type(Fog::Mode m) const; INLINE void enable_primitive_clipping(bool val); INLINE void enable_alpha_test(bool val); diff --git a/panda/src/egg2pg/Sources.pp b/panda/src/egg2pg/Sources.pp index d7c389c7fd..acd363d8bb 100644 --- a/panda/src/egg2pg/Sources.pp +++ b/panda/src/egg2pg/Sources.pp @@ -12,26 +12,25 @@ #define SOURCES \ animBundleMaker.h \ - qpcharacterMaker.h \ + characterMaker.h \ computedVerticesMaker.I computedVerticesMaker.h \ computedVerticesMakerEntity.I computedVerticesMakerEntity.h \ config_egg2pg.h \ deferredNodeProperty.h \ eggBinner.h \ - eggLoaderBase.h \ - qpeggLoader.h \ - qpload_egg_file.h \ + eggLoader.h \ + load_egg_file.h \ loaderFileTypeEgg.h #define INCLUDED_SOURCES \ animBundleMaker.cxx \ - qpcharacterMaker.cxx \ + characterMaker.cxx \ computedVerticesMaker.cxx \ config_egg2pg.cxx \ deferredNodeProperty.cxx \ eggBinner.cxx \ - qpeggLoader.cxx \ - qpload_egg_file.cxx \ + eggLoader.cxx \ + load_egg_file.cxx \ loaderFileTypeEgg.cxx #if $[DONT_COMBINE_PGRAPH] @@ -41,6 +40,6 @@ #endif #define INSTALL_HEADERS \ - qpload_egg_file.h config_egg2pg.h + load_egg_file.h config_egg2pg.h #end lib_target diff --git a/panda/src/egg2pg/animBundleMaker.cxx b/panda/src/egg2pg/animBundleMaker.cxx index 15d159c26e..04748f1d83 100644 --- a/panda/src/egg2pg/animBundleMaker.cxx +++ b/panda/src/egg2pg/animBundleMaker.cxx @@ -26,7 +26,7 @@ #include "eggXfmSAnim.h" #include "eggGroupNode.h" #include "animBundle.h" -#include "qpanimBundleNode.h" +#include "animBundleNode.h" #include "animChannelMatrixXfmTable.h" #include "animChannelScalarTable.h" @@ -65,13 +65,13 @@ AnimBundleMaker(EggTable *root) : _root(root) { //////////////////////////////////////////////////////////////////// -// Function: AnimBundleMaker::make_qpnode +// Function: AnimBundleMaker::make_node // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpAnimBundleNode *AnimBundleMaker:: -make_qpnode() { - return new qpAnimBundleNode("", make_bundle()); +AnimBundleNode *AnimBundleMaker:: +make_node() { + return new AnimBundleNode("", make_bundle()); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/egg2pg/animBundleMaker.h b/panda/src/egg2pg/animBundleMaker.h index b224c59bdf..df66c68741 100644 --- a/panda/src/egg2pg/animBundleMaker.h +++ b/panda/src/egg2pg/animBundleMaker.h @@ -29,7 +29,7 @@ class EggXfmSAnim; class EggSAnimData; class AnimGroup; class AnimBundle; -class qpAnimBundleNode; +class AnimBundleNode; class AnimChannelScalarTable; class AnimChannelMatrixXfmTable; @@ -42,7 +42,7 @@ class EXPCL_PANDAEGG AnimBundleMaker { public: AnimBundleMaker(EggTable *root); - qpAnimBundleNode *make_qpnode(); + AnimBundleNode *make_node(); private: AnimBundle *make_bundle(); diff --git a/panda/src/egg2pg/qpcharacterMaker.cxx b/panda/src/egg2pg/characterMaker.cxx similarity index 89% rename from panda/src/egg2pg/qpcharacterMaker.cxx rename to panda/src/egg2pg/characterMaker.cxx index 46300dc1a3..13aeaeb00e 100644 --- a/panda/src/egg2pg/qpcharacterMaker.cxx +++ b/panda/src/egg2pg/characterMaker.cxx @@ -1,4 +1,4 @@ -// Filename: qpcharacterMaker.cxx +// Filename: characterMaker.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcharacterMaker.h" -#include "qpeggLoader.h" +#include "characterMaker.h" +#include "eggLoader.h" #include "config_egg2pg.h" #include "computedVertices.h" @@ -27,19 +27,19 @@ #include "characterJoint.h" #include "characterJointBundle.h" #include "characterSlider.h" -#include "qpcharacter.h" +#include "character.h" #include "transformState.h" //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::Construtor +// Function: CharacterMaker::Construtor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCharacterMaker:: -qpCharacterMaker(EggGroup *root, EggLoaderBase &loader) +CharacterMaker:: +CharacterMaker(EggGroup *root, EggLoader &loader) : _loader(loader), _egg_root(root) { - _character_node = new qpCharacter(_egg_root->get_name()); + _character_node = new Character(_egg_root->get_name()); _bundle = _character_node->get_bundle(); _morph_root = (PartGroup *)NULL; @@ -47,11 +47,11 @@ qpCharacterMaker(EggGroup *root, EggLoaderBase &loader) } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::make_node +// Function: CharacterMaker::make_node // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCharacter *qpCharacterMaker:: +Character *CharacterMaker:: make_node() { make_bundle(); _character_node->_parts = _parts; @@ -60,14 +60,14 @@ make_node() { //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::egg_to_part +// Function: CharacterMaker::egg_to_part // Access: Public // Description: Returns the PartGroup node associated with the given // egg node. If the egg node is not a node in the // character's hierarchy, returns the top of the // character's hierarchy. //////////////////////////////////////////////////////////////////// -PartGroup *qpCharacterMaker:: +PartGroup *CharacterMaker:: egg_to_part(EggNode *egg_node) const { int index = egg_to_index(egg_node); if (index < 0) { @@ -80,12 +80,12 @@ egg_to_part(EggNode *egg_node) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::egg_to_index +// Function: CharacterMaker::egg_to_index // Access: Public // Description: Returns the index number associated with the // PartGroup node for the given egg node, or -1. //////////////////////////////////////////////////////////////////// -int qpCharacterMaker:: +int CharacterMaker:: egg_to_index(EggNode *egg_node) const { NodeMap::const_iterator nmi = _node_map.find(egg_node); if (nmi == _node_map.end()) { @@ -95,19 +95,19 @@ egg_to_index(EggNode *egg_node) const { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::part_to_node +// Function: CharacterMaker::part_to_node // Access: Public // Description: Returns the scene graph node associated with the // given PartGroup node, if there is one. If the // PartGroup does not have an associated node, returns // the character's top node. //////////////////////////////////////////////////////////////////// -PandaNode *qpCharacterMaker:: +PandaNode *CharacterMaker:: part_to_node(PartGroup *part) const { if (part->is_of_type(CharacterJoint::get_class_type())) { CharacterJoint *joint = DCAST(CharacterJoint, part); - if (joint->_qpgeom_node != (PandaNode *)NULL) { - return joint->_qpgeom_node; + if (joint->_geom_node != (PandaNode *)NULL) { + return joint->_geom_node; } } @@ -116,14 +116,14 @@ part_to_node(PartGroup *part) const { //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::create_slider +// Function: CharacterMaker::create_slider // Access: Public // Description: Creates a new morph slider of the given name, and // returns its index. This is actually called by // ComputedVerticesMaker, which is responsible for // identifying all the unique morph target names. //////////////////////////////////////////////////////////////////// -int qpCharacterMaker:: +int CharacterMaker:: create_slider(const string &name) { if (_morph_root == (PartGroup *)NULL) { _morph_root = new PartGroup(_bundle, "morph"); @@ -136,11 +136,11 @@ create_slider(const string &name) { //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::make_bundle +// Function: CharacterMaker::make_bundle // Access: Private // Description: //////////////////////////////////////////////////////////////////// -CharacterJointBundle *qpCharacterMaker:: +CharacterJointBundle *CharacterMaker:: make_bundle() { build_joint_hierarchy(_egg_root, _skeleton_root); _bundle->sort_descendants(); @@ -155,11 +155,11 @@ make_bundle() { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::build_hierarchy +// Function: CharacterMaker::build_hierarchy // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCharacterMaker:: +void CharacterMaker:: build_joint_hierarchy(EggNode *egg_node, PartGroup *part) { int index = -1; @@ -188,7 +188,7 @@ build_joint_hierarchy(EggNode *egg_node, PartGroup *part) { if (egg_group->get_dcs_flag()) { // If the joint requested an explicit DCS, create a node for // it. - joint->_qpgeom_node = new PandaNode(egg_group->get_name()); + joint->_geom_node = new PandaNode(egg_group->get_name()); } part = joint; @@ -204,17 +204,17 @@ build_joint_hierarchy(EggNode *egg_node, PartGroup *part) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::parent_joint_nodes +// Function: CharacterMaker::parent_joint_nodes // Access: Private // Description: Walks the joint hierarchy, and parents any explicit // nodes created for the joints under the character // node. //////////////////////////////////////////////////////////////////// -void qpCharacterMaker:: +void CharacterMaker:: parent_joint_nodes(PartGroup *part) { if (part->is_of_type(CharacterJoint::get_class_type())) { CharacterJoint *joint = DCAST(CharacterJoint, part); - PandaNode *joint_node = joint->_qpgeom_node; + PandaNode *joint_node = joint->_geom_node; if (joint_node != NULL) { _character_node->add_child(joint_node); joint->add_net_transform(joint_node); @@ -228,11 +228,11 @@ parent_joint_nodes(PartGroup *part) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::make_geometry +// Function: CharacterMaker::make_geometry // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCharacterMaker:: +void CharacterMaker:: make_geometry(EggNode *egg_node) { if (egg_node->is_of_type(EggPrimitive::get_class_type())) { EggPrimitive *egg_primitive = DCAST(EggPrimitive, egg_node); @@ -263,11 +263,11 @@ make_geometry(EggNode *egg_node) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::make_static_primitive +// Function: CharacterMaker::make_static_primitive // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCharacterMaker:: +void CharacterMaker:: make_static_primitive(EggPrimitive *egg_primitive, EggGroupNode *prim_home) { PandaNode *node = part_to_node(egg_to_part(prim_home)); @@ -281,11 +281,11 @@ make_static_primitive(EggPrimitive *egg_primitive, EggGroupNode *prim_home) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::make_dynamic_primitive +// Function: CharacterMaker::make_dynamic_primitive // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpCharacterMaker:: +void CharacterMaker:: make_dynamic_primitive(EggPrimitive *egg_primitive, EggGroupNode *prim_home) { PandaNode *node = part_to_node(egg_to_part(prim_home)); @@ -298,11 +298,11 @@ make_dynamic_primitive(EggPrimitive *egg_primitive, EggGroupNode *prim_home) { } //////////////////////////////////////////////////////////////////// -// Function: qpCharacterMaker::determine_primitive_home +// Function: CharacterMaker::determine_primitive_home // Access: Private // Description: //////////////////////////////////////////////////////////////////// -EggGroupNode *qpCharacterMaker:: +EggGroupNode *CharacterMaker:: determine_primitive_home(EggPrimitive *egg_primitive) { // A primitive's vertices may be referenced by any joint in the // character. Or, the primitive itself may be explicitly placed diff --git a/panda/src/egg2pg/qpcharacterMaker.h b/panda/src/egg2pg/characterMaker.h similarity index 87% rename from panda/src/egg2pg/qpcharacterMaker.h rename to panda/src/egg2pg/characterMaker.h index a66fd9c19e..a66f74ebaf 100644 --- a/panda/src/egg2pg/qpcharacterMaker.h +++ b/panda/src/egg2pg/characterMaker.h @@ -1,4 +1,4 @@ -// Filename: qpcharacterMaker.h +// Filename: characterMaker.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCHARACTERMAKER_H -#define qpCHARACTERMAKER_H +#ifndef CHARACTERMAKER_H +#define CHARACTERMAKER_H #include "pandabase.h" @@ -37,19 +37,19 @@ class Character; class CharacterSlider; class MovingPartBase; class NamedNode; -class EggLoaderBase; +class EggLoader; /////////////////////////////////////////////////////////////////// -// Class : qpCharacterMaker +// Class : CharacterMaker // Description : Converts an EggGroup hierarchy, beginning with a // group with set, to a character node with // joints. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAEGG qpCharacterMaker { +class EXPCL_PANDAEGG CharacterMaker { public: - qpCharacterMaker(EggGroup *root, EggLoaderBase &loader); + CharacterMaker(EggGroup *root, EggLoader &loader); - qpCharacter *make_node(); + Character *make_node(); PartGroup *egg_to_part(EggNode *egg_node) const; int egg_to_index(EggNode *egg_node) const; @@ -76,9 +76,9 @@ private: typedef vector_PartGroupStar Parts; Parts _parts; - EggLoaderBase &_loader; + EggLoader &_loader; EggGroup *_egg_root; - qpCharacter *_character_node; + Character *_character_node; CharacterJointBundle *_bundle; ComputedVerticesMaker _comp_verts_maker; PartGroup *_morph_root; diff --git a/panda/src/egg2pg/computedVerticesMaker.cxx b/panda/src/egg2pg/computedVerticesMaker.cxx index e1c87af512..2eb4ea3cb3 100644 --- a/panda/src/egg2pg/computedVerticesMaker.cxx +++ b/panda/src/egg2pg/computedVerticesMaker.cxx @@ -17,10 +17,10 @@ //////////////////////////////////////////////////////////////////// #include "computedVerticesMaker.h" -#include "qpcharacterMaker.h" +#include "characterMaker.h" #include "characterJoint.h" -#include "qpcharacter.h" +#include "character.h" #include "computedVertices.h" #include "eggNode.h" #include "eggGroup.h" @@ -319,7 +319,7 @@ add_color(const Colorf &color, const EggMorphColorList &morphs) { // returns it. //////////////////////////////////////////////////////////////////// ComputedVertices *ComputedVerticesMaker:: -make_computed_vertices(qpCharacter *character, qpCharacterMaker &char_maker) { +make_computed_vertices(Character *character, CharacterMaker &char_maker) { // We must first build up a set of all the unique kinds of vertex // transforms. typedef pset VertexTransforms; diff --git a/panda/src/egg2pg/computedVerticesMaker.h b/panda/src/egg2pg/computedVerticesMaker.h index 5ba17bf649..e7093a093d 100644 --- a/panda/src/egg2pg/computedVerticesMaker.h +++ b/panda/src/egg2pg/computedVerticesMaker.h @@ -37,7 +37,7 @@ #include "pmap.h" class ComputedVertices; -class qpCharacterMaker; +class CharacterMaker; class EggNode; class EggVertex; @@ -78,8 +78,8 @@ public: const LMatrix3d &transform); int add_color(const Colorf &color, const EggMorphColorList &morphs); - ComputedVertices *make_computed_vertices(qpCharacter *character, - qpCharacterMaker &char_maker); + ComputedVertices *make_computed_vertices(Character *character, + CharacterMaker &char_maker); void write(ostream &out) const; diff --git a/panda/src/egg2pg/deferredNodeProperty.cxx b/panda/src/egg2pg/deferredNodeProperty.cxx index 29ddaf77cd..27184fb3bc 100644 --- a/panda/src/egg2pg/deferredNodeProperty.cxx +++ b/panda/src/egg2pg/deferredNodeProperty.cxx @@ -18,7 +18,7 @@ #include "deferredNodeProperty.h" -#include "qpcollisionNode.h" +#include "collisionNode.h" #include "pandaNode.h" #include "dcast.h" @@ -83,8 +83,8 @@ compose(const DeferredNodeProperty &other) { //////////////////////////////////////////////////////////////////// void DeferredNodeProperty:: apply_to_node(PandaNode *node) { - if (node->is_of_type(qpCollisionNode::get_class_type())) { - qpCollisionNode *cnode = DCAST(qpCollisionNode, node); + if (node->is_of_type(CollisionNode::get_class_type())) { + CollisionNode *cnode = DCAST(CollisionNode, node); if ((_flags & F_has_from_collide_mask) != 0) { cnode->set_from_collide_mask(_from_collide_mask); } diff --git a/panda/src/egg2pg/egg2pg_composite1.cxx b/panda/src/egg2pg/egg2pg_composite1.cxx index a8d6ef5060..4a6f131d61 100644 --- a/panda/src/egg2pg/egg2pg_composite1.cxx +++ b/panda/src/egg2pg/egg2pg_composite1.cxx @@ -1,4 +1,4 @@ #include "animBundleMaker.cxx" -#include "qpcharacterMaker.cxx" +#include "characterMaker.cxx" #include "computedVerticesMaker.cxx" #include "config_egg2pg.cxx" diff --git a/panda/src/egg2pg/egg2pg_composite2.cxx b/panda/src/egg2pg/egg2pg_composite2.cxx index 43a13e6bd7..9824665353 100644 --- a/panda/src/egg2pg/egg2pg_composite2.cxx +++ b/panda/src/egg2pg/egg2pg_composite2.cxx @@ -1,6 +1,6 @@ #include "deferredNodeProperty.cxx" #include "eggBinner.cxx" -#include "qpeggLoader.cxx" -#include "qpload_egg_file.cxx" +#include "eggLoader.cxx" +#include "load_egg_file.cxx" #include "loaderFileTypeEgg.cxx" diff --git a/panda/src/egg2pg/qpeggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx similarity index 93% rename from panda/src/egg2pg/qpeggLoader.cxx rename to panda/src/egg2pg/eggLoader.cxx index a9f8efd714..2eace6d1f1 100644 --- a/panda/src/egg2pg/qpeggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -1,4 +1,4 @@ -// Filename: qpqpEggLoader.cxx +// Filename: EggLoader.cxx // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,9 +18,9 @@ #include "pandabase.h" -#include "qpeggLoader.h" +#include "eggLoader.h" #include "config_egg2pg.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "renderState.h" #include "transformState.h" #include "textureAttrib.h" @@ -35,11 +35,11 @@ #include "depthWriteAttrib.h" #include "materialAttrib.h" #include "materialPool.h" -#include "qpgeomNode.h" -#include "qpsequenceNode.h" -#include "qplodNode.h" -#include "qpmodelNode.h" -#include "qpmodelRoot.h" +#include "geomNode.h" +#include "sequenceNode.h" +#include "lodNode.h" +#include "modelNode.h" +#include "modelRoot.h" #include "string_utils.h" #include "eggPrimitive.h" #include "eggPoint.h" @@ -51,12 +51,12 @@ #include "eggBin.h" #include "eggTable.h" #include "eggBinner.h" -#include "qpcharacterMaker.h" -#include "qpcharacter.h" +#include "characterMaker.h" +#include "character.h" #include "animBundleMaker.h" -#include "qpanimBundleNode.h" +#include "animBundleNode.h" #include "selectiveChildNode.h" -#include "qpcollisionNode.h" +#include "collisionNode.h" #include "collisionSphere.h" #include "collisionPlane.h" #include "collisionPolygon.h" @@ -99,24 +99,24 @@ LODInstance(EggNode *egg_node) { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::Constructor +// Function: EggLoader::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpEggLoader:: -qpEggLoader() { +EggLoader:: +EggLoader() { // We need to enforce whatever coordinate system the user asked for. _data.set_coordinate_system(egg_coordinate_system); _error = false; } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::Constructor +// Function: EggLoader::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpEggLoader:: -qpEggLoader(const EggData &data) : +EggLoader:: +EggLoader(const EggData &data) : _data(data) { _error = false; @@ -124,11 +124,11 @@ qpEggLoader(const EggData &data) : //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::build_graph +// Function: EggLoader::build_graph // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: build_graph() { _deferred_nodes.clear(); @@ -140,9 +140,9 @@ build_graph() { load_textures(); // Now build up the scene graph. - _root = new qpModelRoot(_data.get_egg_filename().get_basename()); + _root = new ModelRoot(_data.get_egg_filename().get_basename()); make_node(&_data, _root); - _builder.qpbuild(); + _builder.build(); reparent_decals(); @@ -151,30 +151,30 @@ build_graph() { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::reparent_decals +// Function: EggLoader::reparent_decals // Access: Public // Description: For each node representing a decal base geometry // (i.e. a node corresponding to an EggGroup with the // decal flag set), move all of its nested geometry // directly below the GeomNode representing the group. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: reparent_decals() { Decals::const_iterator di; for (di = _decals.begin(); di != _decals.end(); ++di) { PandaNode *node = (*di); nassertv(node != (PandaNode *)NULL); - // The qpNodePath interface is best for this. - qpNodePath parent(node); + // The NodePath interface is best for this. + NodePath parent(node); // First, search for the GeomNode. - qpNodePath geom_parent; + NodePath geom_parent; int num_children = parent.get_num_children(); for (int i = 0; i < num_children; i++) { - qpNodePath child = parent.get_child(i); + NodePath child = parent.get_child(i); - if (child.node()->is_of_type(qpGeomNode::get_class_type())) { + if (child.node()->is_of_type(GeomNode::get_class_type())) { if (!geom_parent.is_empty()) { // Oops, too many GeomNodes. egg2pg_cat.error() @@ -198,9 +198,9 @@ reparent_decals() { // list. int i = 0; while (i < num_children) { - qpNodePath child = parent.get_child(i); + NodePath child = parent.get_child(i); - if (child.node()->is_of_type(qpGeomNode::get_class_type())) { + if (child.node()->is_of_type(GeomNode::get_class_type())) { i++; } else { child.reparent_to(geom_parent); @@ -216,11 +216,11 @@ reparent_decals() { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_nonindexed_primitive +// Function: EggLoader::make_nonindexed_primitive // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: make_nonindexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, const LMatrix4d *transform) { BuilderBucket bucket; @@ -290,11 +290,11 @@ make_nonindexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_indexed_primitive +// Function: EggLoader::make_indexed_primitive // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: make_indexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, const LMatrix4d *transform, ComputedVerticesMaker &_comp_verts_maker) { @@ -413,11 +413,11 @@ make_indexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::load_textures +// Function: EggLoader::load_textures // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: load_textures() { // First, collect all the textures that are referenced. EggTextureCollection tc; @@ -454,11 +454,11 @@ load_textures() { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::load_texture +// Function: EggLoader::load_texture // Access: Private // Description: //////////////////////////////////////////////////////////////////// -bool qpEggLoader:: +bool EggLoader:: load_texture(TextureDef &def, const EggTexture *egg_tex) { Texture *tex; if (egg_tex->has_alpha_file()) { @@ -491,11 +491,11 @@ load_texture(TextureDef &def, const EggTexture *egg_tex) { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::apply_texture_attributes +// Function: EggLoader::apply_texture_attributes // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: apply_texture_attributes(Texture *tex, const EggTexture *egg_tex) { switch (egg_tex->determine_wrap_u()) { case EggTexture::WM_repeat: @@ -781,11 +781,11 @@ apply_texture_attributes(Texture *tex, const EggTexture *egg_tex) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::apply_texture_apply_attributes +// Function: EggLoader::apply_texture_apply_attributes // Access: Private // Description: //////////////////////////////////////////////////////////////////// -CPT(RenderAttrib) qpEggLoader:: +CPT(RenderAttrib) EggLoader:: get_texture_apply_attributes(const EggTexture *egg_tex) { CPT(RenderAttrib) result = TextureApplyAttrib::make(TextureApplyAttrib::M_modulate); if (egg_always_decal_textures) { @@ -815,13 +815,13 @@ get_texture_apply_attributes(const EggTexture *egg_tex) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::get_material_attrib +// Function: EggLoader::get_material_attrib // Access: Private // Description: Returns a RenderAttrib suitable for enabling the // material indicated by the given EggMaterial, and with // the indicated backface flag. //////////////////////////////////////////////////////////////////// -CPT(RenderAttrib) qpEggLoader:: +CPT(RenderAttrib) EggLoader:: get_material_attrib(const EggMaterial *egg_mat, bool bface) { Materials &materials = bface ? _materials_bface : _materials; @@ -871,14 +871,14 @@ get_material_attrib(const EggMaterial *egg_mat, bool bface) { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::setup_bucket +// Function: EggLoader::setup_bucket // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: setup_bucket(BuilderBucket &bucket, PandaNode *parent, EggPrimitive *egg_prim) { - bucket._qpnode = parent; + bucket._node = parent; bucket._mesh = egg_mesh; bucket._retesselate_coplanar = egg_retesselate_coplanar; bucket._unroll_fans = egg_unroll_fans; @@ -1064,11 +1064,11 @@ setup_bucket(BuilderBucket &bucket, PandaNode *parent, //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node +// Function: EggLoader::make_node // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggNode *egg_node, PandaNode *parent) { if (egg_node->is_of_type(EggNurbsCurve::get_class_type())) { return make_node(DCAST(EggNurbsCurve, egg_node), parent); @@ -1088,11 +1088,11 @@ make_node(EggNode *egg_node, PandaNode *parent) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggNurbsCurve) +// Function: EggLoader::make_node (EggNurbsCurve) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggNurbsCurve *egg_curve, PandaNode *parent) { assert(parent != NULL); assert(!parent->is_geom_node()); @@ -1167,14 +1167,14 @@ make_node(EggNurbsCurve *egg_curve, PandaNode *parent) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggPrimitive) +// Function: EggLoader::make_node (EggPrimitive) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggPrimitive *egg_prim, PandaNode *parent) { assert(parent != NULL); - assert(!parent->is_of_type(qpGeomNode::get_class_type())); + assert(!parent->is_of_type(GeomNode::get_class_type())); if (egg_prim->cleanup()) { if (parent->is_of_type(SelectiveChildNode::get_class_type())) { @@ -1197,18 +1197,18 @@ make_node(EggPrimitive *egg_prim, PandaNode *parent) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggBin) +// Function: EggLoader::make_node (EggBin) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggBin *egg_bin, PandaNode *parent) { // Presently, an EggBin can only mean an LOD node (i.e. a parent of // one or more EggGroups with LOD specifications). Later it might // mean other things as well. nassertr((EggBinner::BinNumber)egg_bin->get_bin_number() == EggBinner::BN_lod, NULL); - qpLODNode *lod_node = new qpLODNode(egg_bin->get_name()); + LODNode *lod_node = new LODNode(egg_bin->get_name()); pvector instances; @@ -1247,11 +1247,11 @@ make_node(EggBin *egg_bin, PandaNode *parent) { //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggGroup) +// Function: EggLoader::make_node (EggGroup) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggGroup *egg_group, PandaNode *parent) { PT(PandaNode) node = NULL; @@ -1342,15 +1342,15 @@ make_node(EggGroup *egg_group, PandaNode *parent) { if (egg_group->get_dart_type() != EggGroup::DT_none) { // A group with the flag set means to create a character. - qpCharacterMaker char_maker(egg_group, *this); + CharacterMaker char_maker(egg_group, *this); node = char_maker.make_node(); } else if (egg_group->get_cs_type() != EggGroup::CST_none && egg_group->get_cs_type() != EggGroup::CST_geode) { // A collision group: create collision geometry. - node = new qpCollisionNode(egg_group->get_name()); + node = new CollisionNode(egg_group->get_name()); - make_collision_solids(egg_group, egg_group, (qpCollisionNode *)node.p()); + make_collision_solids(egg_group, egg_group, (CollisionNode *)node.p()); if ((egg_group->get_collide_flags() & EggGroup::CF_keep) != 0) { // If we also specified to keep the geometry, continue the // traversal. @@ -1370,7 +1370,7 @@ make_node(EggGroup *egg_group, PandaNode *parent) { } else if (egg_group->get_switch_flag() && egg_group->get_switch_fps() != 0.0) { // Create a sequence node. - node = new qpSequenceNode(egg_group->get_switch_fps(), + node = new SequenceNode(egg_group->get_switch_fps(), egg_group->get_name()); EggGroup::const_iterator ci; @@ -1380,8 +1380,8 @@ make_node(EggGroup *egg_group, PandaNode *parent) { } else if (egg_group->get_model_flag() || egg_group->get_dcs_flag()) { // A model or DCS flag; create a model node. - node = new qpModelNode(egg_group->get_name()); - DCAST(qpModelNode, node)->set_preserve_transform(egg_group->get_dcs_flag()); + node = new ModelNode(egg_group->get_name()); + DCAST(ModelNode, node)->set_preserve_transform(egg_group->get_dcs_flag()); EggGroup::const_iterator ci; for (ci = egg_group->begin(); ci != egg_group->end(); ++ci) { @@ -1405,14 +1405,14 @@ make_node(EggGroup *egg_group, PandaNode *parent) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::create_group_arc +// Function: EggLoader::create_group_arc // Access: Private // Description: Creates the arc parenting a new group to the scene // graph, and applies any relevant attribs to the // arc according to the EggGroup node that inspired the // group. //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: create_group_arc(EggGroup *egg_group, PandaNode *parent, PandaNode *node) { parent->add_child(node); @@ -1482,11 +1482,11 @@ create_group_arc(EggGroup *egg_group, PandaNode *parent, PandaNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggTable) +// Function: EggLoader::make_node (EggTable) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggTable *egg_table, PandaNode *parent) { if (egg_table->get_table_type() != EggTable::TT_bundle) { // We only do anything with bundles. Isolated tables are treated @@ -1497,18 +1497,18 @@ make_node(EggTable *egg_table, PandaNode *parent) { // It's an actual bundle, so make an AnimBundle from it and its // descendants. AnimBundleMaker bundle_maker(egg_table); - qpAnimBundleNode *node = bundle_maker.make_qpnode(); + AnimBundleNode *node = bundle_maker.make_node(); parent->add_child(node); return node; } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_node (EggGroupNode) +// Function: EggLoader::make_node (EggGroupNode) // Access: Private // Description: //////////////////////////////////////////////////////////////////// -PandaNode *qpEggLoader:: +PandaNode *EggLoader:: make_node(EggGroupNode *egg_group, PandaNode *parent) { PandaNode *node = new PandaNode(egg_group->get_name()); @@ -1522,15 +1522,15 @@ make_node(EggGroupNode *egg_group, PandaNode *parent) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_collision_solids +// Function: EggLoader::make_collision_solids // Access: Private // Description: Creates CollisionSolids corresponding to the // collision geometry indicated at the given node and // below. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: make_collision_solids(EggGroup *start_group, EggGroup *egg_group, - qpCollisionNode *cnode) { + CollisionNode *cnode) { if (egg_group->get_cs_type() != EggGroup::CST_none) { start_group = egg_group; } @@ -1578,13 +1578,13 @@ make_collision_solids(EggGroup *start_group, EggGroup *egg_group, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_collision_plane +// Function: EggLoader::make_collision_plane // Access: Private // Description: Creates a single CollisionPlane corresponding // to the first polygon associated with this group. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: -make_collision_plane(EggGroup *egg_group, qpCollisionNode *cnode, +void EggLoader:: +make_collision_plane(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags) { EggGroup *geom_group = find_collision_geometry(egg_group); if (geom_group != (EggGroup *)NULL) { @@ -1604,13 +1604,13 @@ make_collision_plane(EggGroup *egg_group, qpCollisionNode *cnode, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_collision_polygon +// Function: EggLoader::make_collision_polygon // Access: Private // Description: Creates a single CollisionPolygon corresponding // to the first polygon associated with this group. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: -make_collision_polygon(EggGroup *egg_group, qpCollisionNode *cnode, +void EggLoader:: +make_collision_polygon(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags) { EggGroup *geom_group = find_collision_geometry(egg_group); @@ -1626,13 +1626,13 @@ make_collision_polygon(EggGroup *egg_group, qpCollisionNode *cnode, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_collision_polyset +// Function: EggLoader::make_collision_polyset // Access: Private // Description: Creates a series of CollisionPolygons corresponding // to the polygons associated with this group. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: -make_collision_polyset(EggGroup *egg_group, qpCollisionNode *cnode, +void EggLoader:: +make_collision_polyset(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags) { EggGroup *geom_group = find_collision_geometry(egg_group); if (geom_group != (EggGroup *)NULL) { @@ -1647,13 +1647,13 @@ make_collision_polyset(EggGroup *egg_group, qpCollisionNode *cnode, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::make_collision_sphere +// Function: EggLoader::make_collision_sphere // Access: Private // Description: Creates a single CollisionSphere corresponding // to the polygons associated with this group. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: -make_collision_sphere(EggGroup *egg_group, qpCollisionNode *cnode, +void EggLoader:: +make_collision_sphere(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags) { EggGroup *geom_group = find_collision_geometry(egg_group); if (geom_group != (EggGroup *)NULL) { @@ -1721,13 +1721,13 @@ make_collision_sphere(EggGroup *egg_group, qpCollisionNode *cnode, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::apply_collision_flags +// Function: EggLoader::apply_collision_flags // Access: Private // Description: Does funny stuff to the CollisionSolid as // appropriate, based on the settings of the given // CollideFlags. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: apply_collision_flags(CollisionSolid *solid, EggGroup::CollideFlags flags) { if ((flags & EggGroup::CF_intangible) != 0) { @@ -1736,12 +1736,12 @@ apply_collision_flags(CollisionSolid *solid, } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::find_collision_geometry +// Function: EggLoader::find_collision_geometry // Access: Private // Description: Looks for the node, at or below the indicated node, // that contains the associated collision geometry. //////////////////////////////////////////////////////////////////// -EggGroup *qpEggLoader:: +EggGroup *EggLoader:: find_collision_geometry(EggGroup *egg_group) { if ((egg_group->get_collide_flags() & EggGroup::CF_descend) != 0) { // If we have the "descend" instruction, we'll get to it when we @@ -1774,12 +1774,12 @@ find_collision_geometry(EggGroup *egg_group) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::create_collision_plane +// Function: EggLoader::create_collision_plane // Access: Private // Description: Creates a single CollisionPlane from the indicated // EggPolygon. //////////////////////////////////////////////////////////////////// -CollisionPlane *qpEggLoader:: +CollisionPlane *EggLoader:: create_collision_plane(EggPolygon *egg_poly, EggGroup *parent_group) { if (!egg_poly->cleanup()) { egg2pg_cat.error() @@ -1818,14 +1818,14 @@ create_collision_plane(EggPolygon *egg_poly, EggGroup *parent_group) { } //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::create_collision_polygons +// Function: EggLoader::create_collision_polygons // Access: Private // Description: Creates one or more CollisionPolygons from the // indicated EggPolygon, and adds them to the indicated -// qpCollisionNode. +// CollisionNode. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: -create_collision_polygons(qpCollisionNode *cnode, EggPolygon *egg_poly, +void EggLoader:: +create_collision_polygons(CollisionNode *cnode, EggPolygon *egg_poly, EggGroup *parent_group, EggGroup::CollideFlags flags) { @@ -1884,13 +1884,13 @@ create_collision_polygons(qpCollisionNode *cnode, EggPolygon *egg_poly, //////////////////////////////////////////////////////////////////// -// Function: qpEggLoader::apply_deferred_nodes +// Function: EggLoader::apply_deferred_nodes // Access: Private // Description: Walks back over the tree and applies the // DeferredNodeProperties that were saved up along the // way. //////////////////////////////////////////////////////////////////// -void qpEggLoader:: +void EggLoader:: apply_deferred_nodes(PandaNode *node, const DeferredNodeProperty &prop) { DeferredNodeProperty next_prop(prop); diff --git a/panda/src/egg2pg/qpeggLoader.h b/panda/src/egg2pg/eggLoader.h similarity index 86% rename from panda/src/egg2pg/qpeggLoader.h rename to panda/src/egg2pg/eggLoader.h index 291d2e43d4..6abb5b7242 100644 --- a/panda/src/egg2pg/qpeggLoader.h +++ b/panda/src/egg2pg/eggLoader.h @@ -1,4 +1,4 @@ -// Filename: qpeggLoader.h +// Filename: eggLoader.h // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,12 +16,11 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpEGGLOADER_H -#define qpEGGLOADER_H +#ifndef EGGLOADER_H +#define EGGLOADER_H #include "pandabase.h" -#include "eggLoaderBase.h" #include "deferredNodeProperty.h" #include "eggData.h" #include "eggTexture.h" @@ -47,22 +46,22 @@ class EggMaterial; class ComputedVerticesMaker; class RenderRelation; class CollisionSolid; -class qpCollisionNode; +class CollisionNode; class CollisionPlane; class CollisionPolygon; /////////////////////////////////////////////////////////////////// -// Class : qpEggLoader +// Class : EggLoader // Description : Converts an egg data structure, possibly read from an // egg file but not necessarily, into a scene graph // suitable for rendering. // // This class isn't exported from this package. //////////////////////////////////////////////////////////////////// -class qpEggLoader : public EggLoaderBase { +class EggLoader { public: - qpEggLoader(); - qpEggLoader(const EggData &data); + EggLoader(); + EggLoader(const EggData &data); void build_graph(); void reparent_decals(); @@ -103,21 +102,21 @@ private: PandaNode *make_node(EggGroupNode *egg_group, PandaNode *parent); void make_collision_solids(EggGroup *start_group, EggGroup *egg_group, - qpCollisionNode *cnode); - void make_collision_plane(EggGroup *egg_group, qpCollisionNode *cnode, + CollisionNode *cnode); + void make_collision_plane(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags); - void make_collision_polygon(EggGroup *egg_group, qpCollisionNode *cnode, + void make_collision_polygon(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags); - void make_collision_polyset(EggGroup *egg_group, qpCollisionNode *cnode, + void make_collision_polyset(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags); - void make_collision_sphere(EggGroup *egg_group, qpCollisionNode *cnode, + void make_collision_sphere(EggGroup *egg_group, CollisionNode *cnode, EggGroup::CollideFlags flags); void apply_collision_flags(CollisionSolid *solid, EggGroup::CollideFlags flags); EggGroup *find_collision_geometry(EggGroup *egg_group); CollisionPlane *create_collision_plane(EggPolygon *egg_poly, EggGroup *parent_group); - void create_collision_polygons(qpCollisionNode *cnode, EggPolygon *egg_poly, + void create_collision_polygons(CollisionNode *cnode, EggPolygon *egg_poly, EggGroup *parent_group, EggGroup::CollideFlags flags); diff --git a/panda/src/egg2pg/eggLoaderBase.h b/panda/src/egg2pg/eggLoaderBase.h deleted file mode 100644 index 87577fb8ca..0000000000 --- a/panda/src/egg2pg/eggLoaderBase.h +++ /dev/null @@ -1,56 +0,0 @@ -// Filename: eggLoaderBase.h -// Created by: drose (06Mar02) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - -#ifndef EGGLOADERBASE_H -#define EGGLOADERBASE_H - -#include "pandabase.h" -#include "luse.h" - -class EggPrimitive; -class PandaNode; -class NamedNode; -class ComputedVerticesMaker; - -/////////////////////////////////////////////////////////////////// -// Class : EggLoaderBase -// Description : QP: A temporary hack around having to have two kinds -// of EggLoaders and one kind of CharacterMaker, this -// presents the interface to both kinds of EggLoaders. -//////////////////////////////////////////////////////////////////// -class EggLoaderBase { -public: - virtual ~EggLoaderBase() { } - - virtual void make_nonindexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, - const LMatrix4d *transform = NULL) { } - - virtual void make_indexed_primitive(EggPrimitive *egg_prim, PandaNode *parent, - const LMatrix4d *transform, - ComputedVerticesMaker &_comp_verts_maker) { } - - virtual void make_nonindexed_primitive(EggPrimitive *egg_prim, NamedNode *parent, - const LMatrix4d *transform = NULL) { } - - virtual void make_indexed_primitive(EggPrimitive *egg_prim, NamedNode *parent, - const LMatrix4d *transform, - ComputedVerticesMaker &_comp_verts_maker) { } -}; - -#endif - diff --git a/panda/src/egg2pg/qpload_egg_file.cxx b/panda/src/egg2pg/load_egg_file.cxx similarity index 90% rename from panda/src/egg2pg/qpload_egg_file.cxx rename to panda/src/egg2pg/load_egg_file.cxx index b6fb58b9f7..682201877e 100644 --- a/panda/src/egg2pg/qpload_egg_file.cxx +++ b/panda/src/egg2pg/load_egg_file.cxx @@ -1,4 +1,4 @@ -// Filename: qpload_egg_file.cxx +// Filename: load_egg_file.cxx // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,13 +16,13 @@ // //////////////////////////////////////////////////////////////////// -#include "qpload_egg_file.h" -#include "qpeggLoader.h" +#include "load_egg_file.h" +#include "eggLoader.h" #include "config_egg2pg.h" -#include "qpsceneGraphReducer.h" +#include "sceneGraphReducer.h" static PT(PandaNode) -load_from_loader(qpEggLoader &loader) { +load_from_loader(EggLoader &loader) { loader._data.resolve_externals(); loader.build_graph(); @@ -34,7 +34,7 @@ load_from_loader(qpEggLoader &loader) { } if (loader._root != (PandaNode *)NULL && egg_flatten) { - qpSceneGraphReducer gr; + SceneGraphReducer gr; int num_reduced = gr.flatten(loader._root, egg_flatten_siblings); egg2pg_cat.info() << "Flattened " << num_reduced << " nodes.\n"; } @@ -52,7 +52,7 @@ load_from_loader(qpEggLoader &loader) { // required. //////////////////////////////////////////////////////////////////// PT(PandaNode) -qpload_egg_file(const string &filename, CoordinateSystem cs) { +load_egg_file(const string &filename, CoordinateSystem cs) { Filename egg_filename = Filename::text_filename(filename); if (!egg_filename.exists()) { egg2pg_cat.error() @@ -70,7 +70,7 @@ qpload_egg_file(const string &filename, CoordinateSystem cs) { return NULL; } - qpEggLoader loader; + EggLoader loader; loader._data.set_egg_filename(egg_filename); if (cs != CS_default) { loader._data.set_coordinate_system(cs); @@ -93,13 +93,13 @@ qpload_egg_file(const string &filename, CoordinateSystem cs) { // loading. //////////////////////////////////////////////////////////////////// PT(PandaNode) -qpload_egg_data(EggData &data) { +load_egg_data(EggData &data) { // We temporarily shuttle the children to a holding node so we can // copy them into the EggLoader's structure without it complaining. EggGroupNode children_holder; children_holder.steal_children(data); - qpEggLoader loader(data); + EggLoader loader(data); loader._data.steal_children(children_holder); return load_from_loader(loader); diff --git a/panda/src/egg2pg/qpload_egg_file.h b/panda/src/egg2pg/load_egg_file.h similarity index 90% rename from panda/src/egg2pg/qpload_egg_file.h rename to panda/src/egg2pg/load_egg_file.h index 2a60374cd1..372a601613 100644 --- a/panda/src/egg2pg/qpload_egg_file.h +++ b/panda/src/egg2pg/load_egg_file.h @@ -1,4 +1,4 @@ -// Filename: qpload_egg_file.h +// Filename: load_egg_file.h // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpLOAD_EGG_FILE_H -#define qpLOAD_EGG_FILE_H +#ifndef LOAD_EGG_FILE_H +#define LOAD_EGG_FILE_H #include "pandabase.h" @@ -37,7 +37,7 @@ class EggData; // bit more manual control over the loading process. //////////////////////////////////////////////////////////////////// EXPCL_PANDAEGG PT(PandaNode) -qpload_egg_file(const string &filename, CoordinateSystem cs = CS_default); +load_egg_file(const string &filename, CoordinateSystem cs = CS_default); //////////////////////////////////////////////////////////////////// // Function: load_egg_data @@ -47,6 +47,6 @@ qpload_egg_file(const string &filename, CoordinateSystem cs = CS_default); // loading. //////////////////////////////////////////////////////////////////// EXPCL_PANDAEGG PT(PandaNode) -qpload_egg_data(EggData &data); +load_egg_data(EggData &data); #endif diff --git a/panda/src/egg2pg/loaderFileTypeEgg.cxx b/panda/src/egg2pg/loaderFileTypeEgg.cxx index c907f33dcb..8303cbd91a 100644 --- a/panda/src/egg2pg/loaderFileTypeEgg.cxx +++ b/panda/src/egg2pg/loaderFileTypeEgg.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "loaderFileTypeEgg.h" -#include "qpload_egg_file.h" +#include "load_egg_file.h" #include "eggData.h" @@ -70,7 +70,7 @@ resolve_filename(Filename &path) const { // Description: //////////////////////////////////////////////////////////////////// PT(PandaNode) LoaderFileTypeEgg:: -qpload_file(const Filename &path, bool) const { - PT(PandaNode) result = qpload_egg_file(path); +load_file(const Filename &path, bool) const { + PT(PandaNode) result = load_egg_file(path); return result; } diff --git a/panda/src/egg2pg/loaderFileTypeEgg.h b/panda/src/egg2pg/loaderFileTypeEgg.h index a6a0d3fb23..e3a3d31380 100644 --- a/panda/src/egg2pg/loaderFileTypeEgg.h +++ b/panda/src/egg2pg/loaderFileTypeEgg.h @@ -35,7 +35,7 @@ public: virtual string get_extension() const; virtual void resolve_filename(Filename &path) const; - virtual PT(PandaNode) qpload_file(const Filename &path, bool report_errors) const; + virtual PT(PandaNode) load_file(const Filename &path, bool report_errors) const; public: static TypeHandle get_class_type() { diff --git a/panda/src/framework/pandaFramework.I b/panda/src/framework/pandaFramework.I index 114d31873f..06c869bb05 100644 --- a/panda/src/framework/pandaFramework.I +++ b/panda/src/framework/pandaFramework.I @@ -36,7 +36,7 @@ get_graphics_engine() { // graph of nodes that is traversed to control the // inputs from user devices like the mouse and keyboard. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &PandaFramework:: +INLINE const NodePath &PandaFramework:: get_data_root() const { return _data_root; } diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 2ebd2320bc..3adc5e4fc0 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -20,7 +20,7 @@ #include "clockObject.h" #include "pStatClient.h" #include "eventQueue.h" -#include "qpdataGraphTraverser.h" +#include "dataGraphTraverser.h" #include "interactiveGraphicsPipe.h" #include "config_framework.h" @@ -35,7 +35,7 @@ PandaFramework() : { _is_open = false; _made_default_pipe = false; - _data_root = qpNodePath("data"); + _data_root = NodePath("data"); _window_title = "Panda"; _start_time = 0.0; _frame_count = 0; @@ -366,7 +366,7 @@ enable_default_keys() { bool PandaFramework:: do_frame() { nassertr(_is_open, false); - qpDataGraphTraverser dg_trav; + DataGraphTraverser dg_trav; dg_trav.traverse(_data_root.node()); _event_handler.process_events(); _engine.render_frame(); diff --git a/panda/src/framework/pandaFramework.h b/panda/src/framework/pandaFramework.h index 45398e3794..bd37324ac2 100644 --- a/panda/src/framework/pandaFramework.h +++ b/panda/src/framework/pandaFramework.h @@ -23,7 +23,7 @@ #include "windowFramework.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "eventHandler.h" #include "graphicsPipe.h" #include "graphicsEngine.h" @@ -48,7 +48,7 @@ public: GraphicsPipe *get_default_pipe(); INLINE GraphicsEngine *get_graphics_engine(); - INLINE const qpNodePath &get_data_root() const; + INLINE const NodePath &get_data_root() const; INLINE EventHandler &get_event_handler(); INLINE void set_window_title(const string &title); @@ -106,7 +106,7 @@ private: PT(GraphicsPipe) _default_pipe; GraphicsEngine _engine; - qpNodePath _data_root; + NodePath _data_root; EventHandler _event_handler; typedef pvector Windows; diff --git a/panda/src/framework/windowFramework.I b/panda/src/framework/windowFramework.I index 881a86867c..f5d7333004 100644 --- a/panda/src/framework/windowFramework.I +++ b/panda/src/framework/windowFramework.I @@ -57,7 +57,7 @@ get_num_cameras() const { // Access: Public // Description: Returns the nth camera associated with the window. //////////////////////////////////////////////////////////////////// -INLINE qpCamera *WindowFramework:: +INLINE Camera *WindowFramework:: get_camera(int n) const { nassertr(n >= 0 && n < (int)_cameras.size(), NULL); return _cameras[n]; diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index a188e6f2e7..2c5c2ef30d 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -19,9 +19,9 @@ #include "windowFramework.h" #include "pandaFramework.h" #include "mouseAndKeyboard.h" -#include "qpbuttonThrower.h" -#include "qptrackball.h" -#include "qptransform2sg.h" +#include "buttonThrower.h" +#include "trackball.h" +#include "transform2sg.h" #include "dSearchPath.h" #include "filename.h" #include "loader.h" @@ -119,7 +119,7 @@ close_window() { // in the scene graph. This node may be moved around to // represent the viewpoint. //////////////////////////////////////////////////////////////////// -const qpNodePath &WindowFramework:: +const NodePath &WindowFramework:: get_camera_group() { if (_camera_group.is_empty()) { _camera_group = get_render().attach_new_node("camera_group"); @@ -132,10 +132,10 @@ get_camera_group() { // Access: Public // Description: Returns the root of the 3-d scene graph. //////////////////////////////////////////////////////////////////// -const qpNodePath &WindowFramework:: +const NodePath &WindowFramework:: get_render() { if (_render.is_empty()) { - _render = qpNodePath("render"); + _render = NodePath("render"); // This is maybe here temporarily, and maybe not. _render.set_two_sided(0); @@ -148,10 +148,10 @@ get_render() { // Access: Public // Description: Returns the root of the 2-d scene graph. //////////////////////////////////////////////////////////////////// -const qpNodePath &WindowFramework:: +const NodePath &WindowFramework:: get_render_2d() { if (_render_2d.is_empty()) { - _render_2d = qpNodePath("render_2d"); + _render_2d = NodePath("render_2d"); } return _render_2d; } @@ -162,12 +162,12 @@ get_render_2d() { // Description: Returns the node in the data graph corresponding to // the mouse associated with this window. //////////////////////////////////////////////////////////////////// -const qpNodePath &WindowFramework:: +const NodePath &WindowFramework:: get_mouse() { if (_mouse.is_empty()) { - qpNodePath data_root = _panda_framework->get_data_root(); - qpMouseAndKeyboard *mouse_node = - new qpMouseAndKeyboard(_window, 0, "mouse"); + NodePath data_root = _panda_framework->get_data_root(); + MouseAndKeyboard *mouse_node = + new MouseAndKeyboard(_window, 0, "mouse"); _mouse = data_root.attach_new_node(mouse_node); } return _mouse; @@ -185,9 +185,9 @@ enable_keyboard() { return; } - qpNodePath mouse = get_mouse(); + NodePath mouse = get_mouse(); - PT(qpButtonThrower) bt = new qpButtonThrower("kb-events"); + PT(ButtonThrower) bt = new ButtonThrower("kb-events"); ModifierButtons mods; mods.add_button(KeyboardButton::shift()); mods.add_button(KeyboardButton::control()); @@ -209,14 +209,14 @@ setup_trackball() { return; } - qpNodePath mouse = get_mouse(); - qpNodePath camera = get_camera_group(); + NodePath mouse = get_mouse(); + NodePath camera = get_camera_group(); - PT(qpTrackball) trackball = new qpTrackball("trackball"); + PT(Trackball) trackball = new Trackball("trackball"); trackball->set_pos(LVector3f::forward() * 50.0); mouse.attach_new_node(trackball); - PT(qpTransform2SG) tball2cam = new qpTransform2SG("tball2cam"); + PT(Transform2SG) tball2cam = new Transform2SG("tball2cam"); tball2cam->set_node(camera.node()); trackball->add_child(tball2cam); @@ -234,7 +234,7 @@ setup_trackball() { // false if at least one of them had an error. //////////////////////////////////////////////////////////////////// bool WindowFramework:: -load_models(const qpNodePath &parent, int argc, char *argv[], int first_arg) { +load_models(const NodePath &parent, int argc, char *argv[], int first_arg) { pvector files; for (int i = first_arg; i < argc && argv[i] != (char *)NULL; i++) { @@ -254,15 +254,15 @@ load_models(const qpNodePath &parent, int argc, char *argv[], int first_arg) { // false if at least one of them had an error. //////////////////////////////////////////////////////////////////// bool WindowFramework:: -load_models(const qpNodePath &parent, const pvector &files) { +load_models(const NodePath &parent, const pvector &files) { bool all_ok = true; - qpNodePath render = get_render(); + NodePath render = get_render(); pvector::const_iterator fi; for (fi = files.begin(); fi != files.end(); ++fi) { const Filename &filename = (*fi); - qpNodePath model = load_model(parent, filename); + NodePath model = load_model(parent, filename); if (model.is_empty()) { all_ok = false; } @@ -278,8 +278,8 @@ load_models(const qpNodePath &parent, const pvector &files) { // NodePath, or the empty NodePath if the model could // not be loaded. //////////////////////////////////////////////////////////////////// -qpNodePath WindowFramework:: -load_model(const qpNodePath &parent, Filename filename) { +NodePath WindowFramework:: +load_model(const NodePath &parent, Filename filename) { nout << "Loading " << filename << "\n"; // First, we always try to resolve a filename from the current @@ -289,10 +289,10 @@ load_model(const qpNodePath &parent, Filename filename) { filename.resolve_filename(local_path); Loader loader; - PT(PandaNode) node = loader.qpload_sync(filename); + PT(PandaNode) node = loader.load_sync(filename); if (node == (PandaNode *)NULL) { nout << "Unable to load " << filename << "\n"; - return qpNodePath::not_found(); + return NodePath::not_found(); } return parent.attach_new_node(node); @@ -306,8 +306,8 @@ load_model(const qpNodePath &parent, Filename filename) { // to look at for testing, when no other models are // provided. //////////////////////////////////////////////////////////////////// -qpNodePath WindowFramework:: -load_default_model(const qpNodePath &parent) { +NodePath WindowFramework:: +load_default_model(const NodePath &parent) { PTA_Vertexf coords; PTA_TexCoordf uvs; PTA_Normalf norms; @@ -341,7 +341,7 @@ load_default_model(const qpNodePath &parent) { state = state->add_attrib(TextureAttrib::make(tex)); } - qpGeomNode *geomnode = new qpGeomNode("tri"); + GeomNode *geomnode = new GeomNode("tri"); geomnode->add_geom(geom, state); return parent.attach_new_node(geomnode); @@ -375,7 +375,7 @@ set_wireframe(bool enable) { return; } - qpNodePath render = get_render(); + NodePath render = get_render(); if (enable) { render.set_render_mode_wireframe(override_priority); @@ -402,7 +402,7 @@ set_texture(bool enable) { return; } - qpNodePath render = get_render(); + NodePath render = get_render(); if (!enable) { render.set_texture_off(override_priority); @@ -425,7 +425,7 @@ set_two_sided(bool enable) { return; } - qpNodePath render = get_render(); + NodePath render = get_render(); if (enable) { render.set_two_sided(true, override_priority); @@ -449,7 +449,7 @@ set_lighting(bool enable) { return; } - qpNodePath render = get_render(); + NodePath render = get_render(); if (enable) { if (!_got_lights) { @@ -469,7 +469,7 @@ set_lighting(bool enable) { // Access: Protected // Description: Makes a new 3-d camera for the window. //////////////////////////////////////////////////////////////////// -PT(qpCamera) WindowFramework:: +PT(Camera) WindowFramework:: make_camera() { // Get the first channel on the window. This will be the only // channel on non-SGI hardware. @@ -482,15 +482,15 @@ make_camera() { PT(DisplayRegion) dr = layer->make_display_region(); // Finally, we need a camera to associate with the display region. - PT(qpCamera) camera = new qpCamera("camera"); - qpNodePath camera_np = get_camera_group().attach_new_node(camera); + PT(Camera) camera = new Camera("camera"); + NodePath camera_np = get_camera_group().attach_new_node(camera); _cameras.push_back(camera); PT(Lens) lens = new PerspectiveLens; lens->set_film_size(_window->get_width(), _window->get_height()); camera->set_lens(lens); camera->set_scene(get_render()); - dr->set_qpcamera(camera_np); + dr->set_camera(camera_np); return camera; } @@ -507,8 +507,8 @@ setup_lights() { return; } - qpNodePath camera_group = get_camera_group(); - qpNodePath light_group = camera_group.attach_new_node("lights"); + NodePath camera_group = get_camera_group(); + NodePath light_group = camera_group.attach_new_node("lights"); _alight = new AmbientLight("ambient"); _alight->set_color(Colorf(0.2f, 0.2f, 0.2f, 1.0f)); diff --git a/panda/src/framework/windowFramework.h b/panda/src/framework/windowFramework.h index 358964b8af..42706d4639 100644 --- a/panda/src/framework/windowFramework.h +++ b/panda/src/framework/windowFramework.h @@ -20,8 +20,8 @@ #define WINDOWFRAMEWORK_H #include "pandabase.h" -#include "qpnodePath.h" -#include "qpcamera.h" +#include "nodePath.h" +#include "camera.h" #include "graphicsWindow.h" #include "animControlCollection.h" #include "filename.h" @@ -49,24 +49,24 @@ protected: public: INLINE PandaFramework *get_panda_framework() const; INLINE GraphicsWindow *get_graphics_window() const; - const qpNodePath &get_camera_group(); + const NodePath &get_camera_group(); INLINE int get_num_cameras() const; - INLINE qpCamera *get_camera(int n) const; + INLINE Camera *get_camera(int n) const; - const qpNodePath &get_render(); - const qpNodePath &get_render_2d(); - const qpNodePath &get_mouse(); + const NodePath &get_render(); + const NodePath &get_render_2d(); + const NodePath &get_mouse(); void enable_keyboard(); void setup_trackball(); - bool load_models(const qpNodePath &parent, + bool load_models(const NodePath &parent, int argc, char *argv[], int first_arg = 1); - bool load_models(const qpNodePath &parent, + bool load_models(const NodePath &parent, const pvector &files); - qpNodePath load_model(const qpNodePath &parent, Filename filename); - qpNodePath load_default_model(const qpNodePath &parent); + NodePath load_model(const NodePath &parent, Filename filename); + NodePath load_default_model(const NodePath &parent); void loop_animations(); void set_wireframe(bool enable); @@ -80,22 +80,22 @@ public: INLINE bool get_lighting() const; protected: - PT(qpCamera) make_camera(); + PT(Camera) make_camera(); void setup_lights(); private: PandaFramework *_panda_framework; PT(GraphicsWindow) _window; - qpNodePath _camera_group; - typedef pvector< PT(qpCamera) > Cameras; + NodePath _camera_group; + typedef pvector< PT(Camera) > Cameras; Cameras _cameras; - qpNodePath _render; - qpNodePath _render_2d; + NodePath _render; + NodePath _render_2d; AnimControlCollection _anim_controls; - qpNodePath _mouse; + NodePath _mouse; AmbientLight *_alight; DirectionalLight *_dlight; diff --git a/panda/src/glgsg/glGeomNodeContext.I b/panda/src/glgsg/glGeomNodeContext.I index 56d9c5cd34..69d8471892 100644 --- a/panda/src/glgsg/glGeomNodeContext.I +++ b/panda/src/glgsg/glGeomNodeContext.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE GLGeomNodeContext:: -GLGeomNodeContext(qpGeomNode *node) : +GLGeomNodeContext(GeomNode *node) : GeomNodeContext(node) { _index = 0; diff --git a/panda/src/glgsg/glGeomNodeContext.h b/panda/src/glgsg/glGeomNodeContext.h index 802271c1b2..d291ca959b 100644 --- a/panda/src/glgsg/glGeomNodeContext.h +++ b/panda/src/glgsg/glGeomNodeContext.h @@ -21,7 +21,7 @@ #include "pandabase.h" #include "geomNodeContext.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "pvector.h" #ifdef WIN32_VC @@ -39,7 +39,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAGL GLGeomNodeContext : public GeomNodeContext { public: - INLINE GLGeomNodeContext(qpGeomNode *node); + INLINE GLGeomNodeContext(GeomNode *node); // The GL display list index that draws the contents of this // GeomNode. diff --git a/panda/src/glgsg/glGraphicsStateGuardian.cxx b/panda/src/glgsg/glGraphicsStateGuardian.cxx index 5da055108d..11189e82f7 100644 --- a/panda/src/glgsg/glGraphicsStateGuardian.cxx +++ b/panda/src/glgsg/glGraphicsStateGuardian.cxx @@ -47,10 +47,10 @@ #include "renderModeAttrib.h" #include "fogAttrib.h" #include "depthOffsetAttrib.h" -#include "qpfog.h" +#include "fog.h" #include "clockObject.h" #include "string_utils.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "dcast.h" #include "pvector.h" @@ -785,7 +785,7 @@ draw_sprite(GeomSprite *geom, GeomContext *) { if (!geom->get_alpha_disable()) { // figure out if alpha's enabled (if not, no reason to sort) - const TransparencyAttrib *trans = _qpstate->get_transparency(); + const TransparencyAttrib *trans = _state->get_transparency(); if (trans != (const TransparencyAttrib *)NULL) { alpha = (trans->get_mode() != TransparencyAttrib::M_none); } @@ -1582,7 +1582,7 @@ release_texture(TextureContext *tc) { // contents of the node. //////////////////////////////////////////////////////////////////// GeomNodeContext *GLGraphicsStateGuardian:: -prepare_geom_node(qpGeomNode *node) { +prepare_geom_node(GeomNode *node) { #if 0 // temporarily disabled until we bring to new scene graph // Make sure we have at least some static Geoms in the GeomNode; @@ -1679,7 +1679,7 @@ prepare_geom_node(qpGeomNode *node) { // prepare_geom_node(). //////////////////////////////////////////////////////////////////// void GLGraphicsStateGuardian:: -draw_geom_node(qpGeomNode *node, const RenderState *state, +draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) { #if 0 // temporarily disabled until we bring to new scene graph if (gnc == (GeomNodeContext *)NULL) { @@ -1998,11 +1998,11 @@ void GLGraphicsStateGuardian::apply_material(const Material *material) { // Description: //////////////////////////////////////////////////////////////////// void GLGraphicsStateGuardian:: -apply_fog(qpFog *fog) { - qpFog::Mode fmode = fog->get_mode(); +apply_fog(Fog *fog) { + Fog::Mode fmode = fog->get_mode(); call_glFogMode(get_fog_mode_type(fmode)); - if (fmode == qpFog::M_linear) { + if (fmode == Fog::M_linear) { float onset, opaque; fog->get_linear_range(onset, opaque); call_glFogStart(onset); @@ -2213,8 +2213,8 @@ void GLGraphicsStateGuardian:: issue_fog(const FogAttrib *attrib) { if (!attrib->is_off()) { enable_fog(true); - qpFog *fog = attrib->get_fog(); - nassertv(fog != (qpFog *)NULL); + Fog *fog = attrib->get_fog(); + nassertv(fog != (Fog *)NULL); apply_fog(fog); } else { enable_fog(false); @@ -2262,7 +2262,7 @@ bind_light(PointLight *light, int light_id) { // Position needs to specify x, y, z, and w // w == 1 implies non-infinite position - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LPoint3f pos = light->get_point() * light_mat; @@ -2303,7 +2303,7 @@ bind_light(DirectionalLight *light, int light_id) { // Position needs to specify x, y, z, and w. // w == 0 implies light is at infinity - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LVector3f dir = light->get_direction() * light_mat; LPoint4f fdir(-dir[0], -dir[1], -dir[2], 0); @@ -2348,7 +2348,7 @@ bind_light(Spotlight *light, int light_id) { // Position needs to specify x, y, z, and w // w == 1 implies non-infinite position - qpNodePath light_np(light); + NodePath light_np(light); const LMatrix4f &light_mat = light_np.get_mat(_scene_setup->get_scene_root()); LPoint3f pos = lens->get_nodal_point() * light_mat; LVector3f dir = lens->get_view_vector() * light_mat; @@ -3280,19 +3280,19 @@ get_depth_func_type(DepthTestAttrib::Mode m) const // Description: Maps from the fog types to gl version //////////////////////////////////////////////////////////////////// GLenum GLGraphicsStateGuardian:: -get_fog_mode_type(qpFog::Mode m) const { +get_fog_mode_type(Fog::Mode m) const { switch(m) { - case qpFog::M_linear: return GL_LINEAR; - case qpFog::M_exponential: return GL_EXP; - case qpFog::M_exponential_squared: return GL_EXP2; + case Fog::M_linear: return GL_LINEAR; + case Fog::M_exponential: return GL_EXP; + case Fog::M_exponential_squared: return GL_EXP2; /* #ifdef GL_FOG_FUNC_SGIS - case qpFog::M_spline: return GL_FOG_FUNC_SGIS; + case Fog::M_spline: return GL_FOG_FUNC_SGIS; #endif */ default: - glgsg_cat.error() << "Invalid qpFog::Mode value" << endl; + glgsg_cat.error() << "Invalid Fog::Mode value" << endl; return GL_EXP; } } diff --git a/panda/src/glgsg/glGraphicsStateGuardian.h b/panda/src/glgsg/glGraphicsStateGuardian.h index 7161f9aec1..8556415409 100644 --- a/panda/src/glgsg/glGraphicsStateGuardian.h +++ b/panda/src/glgsg/glGraphicsStateGuardian.h @@ -32,7 +32,7 @@ #include "depthTestAttrib.h" #include "textureApplyAttrib.h" #include "pointerToArray.h" -#include "qpfog.h" +#include "fog.h" #ifdef WIN32_VC // Must include windows.h before gl.h on NT @@ -89,8 +89,8 @@ public: virtual void apply_texture(TextureContext *tc); virtual void release_texture(TextureContext *tc); - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node); - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node); + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc); virtual void release_geom_node(GeomNodeContext *gnc); @@ -107,7 +107,7 @@ public: const RenderBuffer &rb); virtual void apply_material(const Material *material); - void apply_fog(qpFog *fog); + void apply_fog(Fog *fog); virtual void issue_transform(const TransformState *transform); virtual void issue_tex_matrix(const TexMatrixAttrib *attrib); @@ -241,7 +241,7 @@ protected: GLenum get_internal_image_format(PixelBuffer::Format format); GLint get_texture_apply_mode_type(TextureApplyAttrib::Mode am) const; GLenum get_depth_func_type(DepthTestAttrib::Mode m) const; - GLenum get_fog_mode_type(qpFog::Mode m) const; + GLenum get_fog_mode_type(Fog::Mode m) const; static CPT(RenderState) get_untextured_state(); diff --git a/panda/src/gobj/imageBuffer.cxx b/panda/src/gobj/imageBuffer.cxx index 1527636ebd..0bd4c1d39b 100644 --- a/panda/src/gobj/imageBuffer.cxx +++ b/panda/src/gobj/imageBuffer.cxx @@ -90,13 +90,7 @@ write_datagram(BamWriter *, Datagram &me) //////////////////////////////////////////////////////////////////// void ImageBuffer:: fillin(DatagramIterator &scan, BamReader *manager) { - if (manager->get_file_minor_ver() < 6) { - // No _filename before bams 3.6. - set_filename(scan.get_string()); - set_name(_filename.get_basename_wo_extension()); - } else { - set_name(scan.get_string()); - set_filename(scan.get_string()); - } + set_name(scan.get_string()); + set_filename(scan.get_string()); set_alpha_filename(scan.get_string()); } diff --git a/panda/src/gobj/imageBuffer.h b/panda/src/gobj/imageBuffer.h index 87686123a9..c8ff8cf151 100644 --- a/panda/src/gobj/imageBuffer.h +++ b/panda/src/gobj/imageBuffer.h @@ -80,13 +80,12 @@ public: return _type_handle; } static void init_type() { - // This indicates an inheritance from dDrawable, even though we - // don't any more. When we upgrade to Bam version 4.0 we will - // change this. - dDrawable::init_type(); + ReferenceCount::init_type(); + WritableConfigurable::init_type(); Namable::init_type(); register_type(_type_handle, "ImageBuffer", - dDrawable::get_class_type(), + ReferenceCount::get_class_type(), + WritableConfigurable::get_class_type(), Namable::get_class_type()); } virtual TypeHandle get_type() const { diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 12f7e6c506..d6e465e63b 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -638,15 +638,8 @@ make_Texture(const FactoryParams ¶ms) { string name; Filename filename, alpha_filename; - if (manager->get_file_minor_ver() < 6) { - // No _filename before bams 3.6. - filename = scan.get_string(); - name = filename.get_basename_wo_extension(); - } else { - name = scan.get_string(); - filename = scan.get_string(); - } - + name = scan.get_string(); + filename = scan.get_string(); alpha_filename = scan.get_string(); PT(Texture) me; @@ -692,17 +685,10 @@ fillin(DatagramIterator &scan, BamReader *manager) { //makes the assumption that the only data being written is //the name - if (manager->get_file_minor_ver() < 5) { - // Obsolete parameter. - scan.get_uint32(); - } _wrapu = (enum WrapMode) scan.get_uint8(); _wrapv = (enum WrapMode) scan.get_uint8(); _minfilter = (enum FilterType) scan.get_uint8(); _magfilter = (enum FilterType) scan.get_uint8(); - if (manager->get_file_minor_ver() < 5) { - scan.get_uint16(); - } _anisotropic_degree = scan.get_int16(); if (scan.get_remaining_size() > 0) { diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index 09221ae74f..efdfd186d5 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -17,23 +17,17 @@ //////////////////////////////////////////////////////////////////// #ifndef TEXTURE_H #define TEXTURE_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include + +#include "pandabase.h" #include "imageBuffer.h" #include "pixelBuffer.h" -#include +#include "graphicsStateGuardianBase.h" #include "pmap.h" -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - class PNMImage; class TextureContext; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : Texture diff --git a/panda/src/grutil/Sources.pp b/panda/src/grutil/Sources.pp index f9a68ae96e..9d91f10c4b 100644 --- a/panda/src/grutil/Sources.pp +++ b/panda/src/grutil/Sources.pp @@ -9,18 +9,18 @@ #define COMBINED_SOURCES $[TARGET]_composite1.cxx #define SOURCES \ - qpcardMaker.I qpcardMaker.h \ + cardMaker.I cardMaker.h \ config_grutil.h \ - qplineSegs.I qplineSegs.h + lineSegs.I lineSegs.h #define INCLUDED_SOURCES \ - qpcardMaker.cxx \ + cardMaker.cxx \ config_grutil.cxx \ - qplineSegs.cxx + lineSegs.cxx #define INSTALL_HEADERS \ - qpcardMaker.I qpcardMaker.h \ - qplineSegs.I qplineSegs.h + cardMaker.I cardMaker.h \ + lineSegs.I lineSegs.h #define IGATESCAN all diff --git a/panda/src/grutil/qpcardMaker.I b/panda/src/grutil/cardMaker.I similarity index 84% rename from panda/src/grutil/qpcardMaker.I rename to panda/src/grutil/cardMaker.I index eb8be50cdb..3ae5a60251 100644 --- a/panda/src/grutil/qpcardMaker.I +++ b/panda/src/grutil/cardMaker.I @@ -1,4 +1,4 @@ -// Filename: qpcardMaker.I +// Filename: cardMaker.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,26 +18,26 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::Constructor +// Function: CardMaker::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpCardMaker:: -qpCardMaker(const string &name) : Namable(name) { +INLINE CardMaker:: +CardMaker(const string &name) : Namable(name) { reset(); } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::Destructor +// Function: CardMaker::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpCardMaker:: -~qpCardMaker() { +INLINE CardMaker:: +~CardMaker() { } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_uv_range +// Function: CardMaker::set_uv_range // Access: Public // Description: Sets the range of UV's that will be applied to the // vertices. If set_has_uvs() is true (as it is by @@ -45,66 +45,66 @@ INLINE qpCardMaker:: // indicated range of UV's, which will be useful if a // texture is applied. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_uv_range(const TexCoordf &ll, const TexCoordf &ur) { _ll = ll; _ur = ur; } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_has_uvs +// Function: CardMaker::set_has_uvs // Access: Public // Description: Sets the flag indicating whether vertices will be // generated with UV's or not. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_has_uvs(bool flag) { _has_uvs = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_frame +// Function: CardMaker::set_frame // Access: Public // Description: Sets the size of the card. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_frame(float left, float right, float bottom, float top) { set_frame(LVecBase4f(left, right, bottom, top)); } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_frame +// Function: CardMaker::set_frame // Access: Public // Description: Sets the size of the card. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_frame(const LVecBase4f &frame) { _frame = frame; } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_color +// Function: CardMaker::set_color // Access: Public // Description: Sets the color of the card. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_color(float r, float g, float b, float a) { set_color(LVecBase4f(r, g, b, a)); } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_color +// Function: CardMaker::set_color // Access: Public // Description: Sets the color of the card. //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_color(const LVecBase4f &color) { _color = color; _has_color = true; } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::set_source_geometry +// Function: CardMaker::set_source_geometry // Access: Published // Description: Sets a node that will be copied (and scaled and // translated) to generate the frame, instead of @@ -118,19 +118,19 @@ set_color(const LVecBase4f &color) { // it the size and aspect ratio specified by // set_frame(). //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: set_source_geometry(PandaNode *node, const LVecBase4f &frame) { _source_geometry = node; _source_frame = frame; } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::clear_source_geometry +// Function: CardMaker::clear_source_geometry // Access: Published // Description: Removes the node specified by an earlier call to // set_source_geometry(). //////////////////////////////////////////////////////////////////// -INLINE void qpCardMaker:: +INLINE void CardMaker:: clear_source_geometry() { _source_geometry = (PandaNode *)NULL; } diff --git a/panda/src/grutil/qpcardMaker.cxx b/panda/src/grutil/cardMaker.cxx similarity index 90% rename from panda/src/grutil/qpcardMaker.cxx rename to panda/src/grutil/cardMaker.cxx index b3977b8297..e4fdfbacef 100644 --- a/panda/src/grutil/qpcardMaker.cxx +++ b/panda/src/grutil/cardMaker.cxx @@ -1,4 +1,4 @@ -// Filename: qpcardMaker.cxx +// Filename: cardMaker.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,20 +16,20 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcardMaker.h" -#include "qpgeomNode.h" +#include "cardMaker.h" +#include "geomNode.h" #include "geomTristrip.h" #include "transformState.h" #include "colorAttrib.h" -#include "qpsceneGraphReducer.h" +#include "sceneGraphReducer.h" //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::reset +// Function: CardMaker::reset // Access: Public // Description: Resets all the parameters to their initial defaults. //////////////////////////////////////////////////////////////////// -void qpCardMaker:: +void CardMaker:: reset() { _has_uvs = true; _ll.set(0.0f, 0.0f); @@ -43,18 +43,18 @@ reset() { //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::generate +// Function: CardMaker::generate // Access: Public // Description: Generates a GeomNode that renders the specified // geometry. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpCardMaker:: +PT(PandaNode) CardMaker:: generate() { if (_source_geometry != (PandaNode *)NULL) { return rescale_source_geometry(); } - PT(qpGeomNode) gnode = new qpGeomNode(get_name()); + PT(GeomNode) gnode = new GeomNode(get_name()); Geom *geom = new GeomTristrip; gnode->add_geom(geom); @@ -94,12 +94,12 @@ generate() { } //////////////////////////////////////////////////////////////////// -// Function: qpCardMaker::rescale_source_geometry +// Function: CardMaker::rescale_source_geometry // Access: Private // Description: Generates the card by rescaling the source geometry // appropriately. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpCardMaker:: +PT(PandaNode) CardMaker:: rescale_source_geometry() { PT(PandaNode) root = _source_geometry->copy_subgraph(); @@ -129,7 +129,7 @@ rescale_source_geometry() { } // Now flatten out the geometry as much as we can. - qpSceneGraphReducer reducer; + SceneGraphReducer reducer; reducer.apply_attribs(root); reducer.flatten(root, true); diff --git a/panda/src/grutil/qpcardMaker.h b/panda/src/grutil/cardMaker.h similarity index 88% rename from panda/src/grutil/qpcardMaker.h rename to panda/src/grutil/cardMaker.h index 32ec58123d..13e0ee54a4 100644 --- a/panda/src/grutil/qpcardMaker.h +++ b/panda/src/grutil/cardMaker.h @@ -1,4 +1,4 @@ -// Filename: qpcardMaker.h +// Filename: cardMaker.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCARDMAKER_H -#define qpCARDMAKER_H +#ifndef CARDMAKER_H +#define CARDMAKER_H #include "pandabase.h" @@ -27,15 +27,15 @@ #include "namable.h" //////////////////////////////////////////////////////////////////// -// Class : qpCardMaker +// Class : CardMaker // Description : This class generates 2-d "cards", that is, // rectangular polygons, particularly useful for showing // textures etc. in the 2-d scene graph. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCardMaker : public Namable { +class EXPCL_PANDA CardMaker : public Namable { PUBLISHED: - INLINE qpCardMaker(const string &name); - INLINE ~qpCardMaker(); + INLINE CardMaker(const string &name); + INLINE ~CardMaker(); void reset(); INLINE void set_uv_range(const TexCoordf &ll, const TexCoordf &ur); @@ -66,7 +66,7 @@ private: LVecBase4f _source_frame; }; -#include "qpcardMaker.I" +#include "cardMaker.I" #endif diff --git a/panda/src/grutil/grutil_composite1.cxx b/panda/src/grutil/grutil_composite1.cxx index 3eacc9deb0..96deeee4ee 100644 --- a/panda/src/grutil/grutil_composite1.cxx +++ b/panda/src/grutil/grutil_composite1.cxx @@ -1,7 +1,7 @@ -#include "qpcardMaker.cxx" +#include "cardMaker.cxx" #include "config_grutil.cxx" -#include "qplineSegs.cxx" +#include "lineSegs.cxx" diff --git a/panda/src/grutil/qplineSegs.I b/panda/src/grutil/lineSegs.I similarity index 85% rename from panda/src/grutil/qplineSegs.I rename to panda/src/grutil/lineSegs.I index 9bd799e679..f3fd27a176 100644 --- a/panda/src/grutil/qplineSegs.I +++ b/panda/src/grutil/lineSegs.I @@ -1,4 +1,4 @@ -// Filename: qplineSegs.I +// Filename: lineSegs.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,20 +17,20 @@ //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Point::Constructor +// Function: LineSegs::Point::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLineSegs::Point:: +INLINE LineSegs::Point:: Point() { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Point::Constructor +// Function: LineSegs::Point::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLineSegs::Point:: +INLINE LineSegs::Point:: Point(const LVecBase3f &point, const Colorf &color) : _point(point[0], point[1], point[2]), _color(color) @@ -38,80 +38,80 @@ Point(const LVecBase3f &point, const Colorf &color) : } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Point::Copy Constructor +// Function: LineSegs::Point::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLineSegs::Point:: -Point(const qpLineSegs::Point ©) : +INLINE LineSegs::Point:: +Point(const LineSegs::Point ©) : _point(copy._point), _color(copy._color) { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Point::Copy Assignment Operator +// Function: LineSegs::Point::Copy Assignment Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs::Point:: -operator = (const qpLineSegs::Point ©) { +INLINE void LineSegs::Point:: +operator = (const LineSegs::Point ©) { _point = copy._point; _color = copy._color; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_color +// Function: LineSegs::set_color // Access: Public // Description: Establishes the color that will be assigned to all // vertices created by future calls to move_to() and // draw_to(). //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_color(float r, float g, float b, float a) { _color.set(r, g, b, a); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_color +// Function: LineSegs::set_color // Access: Public // Description: Establishes the color that will be assigned to all // vertices created by future calls to move_to() and // draw_to(). //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_color(const Colorf &color) { _color = color; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_thickness +// Function: LineSegs::set_thickness // Access: Public // Description: Establishes the line thickness or point size in // pixels that will be assigned to all lines and points // created by future calls to create(). //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_thickness(float thick) { _thick = thick; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::move_to +// Function: LineSegs::move_to // Access: Public // Description: Moves the pen to the given point without drawing a // line. When followed by draw_to(), this marks the // first point of a line segment; when followed by // move_to() or create(), this creates a single point. //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: move_to(float x, float y, float z) { move_to(Vertexf(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::draw_to +// Function: LineSegs::draw_to // Access: Public // Description: Draws a line segment from the pen's last position // (the last call to move_to or draw_to) to the @@ -119,13 +119,13 @@ move_to(float x, float y, float z) { // tables; the actual drawing is performed when create() // is called. //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: draw_to(float x, float y, float z) { draw_to(Vertexf(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::create +// Function: LineSegs::create // Access: Public // Description: Creates a new GeomNode that will render the series of // line segments and points described via calls to @@ -138,27 +138,27 @@ draw_to(float x, float y, float z) { // calls to set_vertex or set_vertex_color will be // visually correct. //////////////////////////////////////////////////////////////////// -INLINE qpGeomNode *qpLineSegs:: +INLINE GeomNode *LineSegs:: create(bool frame_accurate) { - qpGeomNode *gnode = new qpGeomNode(get_name()); + GeomNode *gnode = new GeomNode(get_name()); return create(gnode, frame_accurate); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::get_num_vertices +// Function: LineSegs::get_num_vertices // Access: Public // Description: Returns the total number of line segment and point // vertices generated by the last call to create(). The // positions of these vertices may be read and adjusted // through get_vertex() and set_vertex(). //////////////////////////////////////////////////////////////////// -INLINE int qpLineSegs:: +INLINE int LineSegs:: get_num_vertices() const { return _created_verts.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::get_vertex +// Function: LineSegs::get_vertex // Access: Public // Description: Returns the nth point or vertex of the line segment // sequence generated by the last call to create(). The @@ -166,7 +166,7 @@ get_num_vertices() const { // move_to() and draw_to() calls generate consecutively // higher vertex numbers. //////////////////////////////////////////////////////////////////// -INLINE Vertexf qpLineSegs:: +INLINE Vertexf LineSegs:: get_vertex(int vertex) const { nassertr(vertex >= 0 && vertex < (int)_created_verts.size(), Vertexf(0.0f, 0.0f, 0.0f)); @@ -174,7 +174,7 @@ get_vertex(int vertex) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_vertex +// Function: LineSegs::set_vertex // Access: Public // Description: Moves the nth point or vertex of the line segment // sequence generated by the last call to create(). The @@ -182,14 +182,14 @@ get_vertex(int vertex) const { // move_to() and draw_to() calls generate consecutively // higher vertex numbers. //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_vertex(int vertex, const Vertexf &vert) { nassertv(vertex >= 0 && vertex < (int)_created_verts.size()); _created_verts[vertex] = vert; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_vertex +// Function: LineSegs::set_vertex // Access: Public // Description: Moves the nth point or vertex of the line segment // sequence generated by the last call to create(). The @@ -197,17 +197,17 @@ set_vertex(int vertex, const Vertexf &vert) { // move_to() and draw_to() calls generate consecutively // higher vertex numbers. //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_vertex(int vertex, float x, float y, float z) { set_vertex(vertex, Vertexf(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::get_vertex_color +// Function: LineSegs::get_vertex_color // Access: Public // Description: Returns the color of the nth point or vertex/ //////////////////////////////////////////////////////////////////// -INLINE Colorf qpLineSegs:: +INLINE Colorf LineSegs:: get_vertex_color(int vertex) const { nassertr(vertex >= 0 && vertex < (int)_created_colors.size(), Colorf(0.0f, 0.0f, 0.0f, 0.0f)); @@ -215,24 +215,24 @@ get_vertex_color(int vertex) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_vertex_color +// Function: LineSegs::set_vertex_color // Access: Public // Description: Changes the vertex color of the nth point or vertex. // See set_vertex(). //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_vertex_color(int vertex, const Colorf &color) { nassertv(vertex >= 0 && vertex < (int)_created_verts.size()); _created_colors[vertex] = color; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::set_vertex_color +// Function: LineSegs::set_vertex_color // Access: Public // Description: Changes the vertex color of the nth point or vertex. // See set_vertex(). //////////////////////////////////////////////////////////////////// -INLINE void qpLineSegs:: +INLINE void LineSegs:: set_vertex_color(int vertex, float r, float g, float b, float a) { set_vertex_color(vertex, Colorf(r, g, b, a)); } diff --git a/panda/src/grutil/qplineSegs.cxx b/panda/src/grutil/lineSegs.cxx similarity index 91% rename from panda/src/grutil/qplineSegs.cxx rename to panda/src/grutil/lineSegs.cxx index 3f378d479c..2e2557e7e6 100644 --- a/panda/src/grutil/qplineSegs.cxx +++ b/panda/src/grutil/lineSegs.cxx @@ -1,4 +1,4 @@ -// Filename: qplineSegs.cxx +// Filename: lineSegs.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,12 +16,12 @@ // //////////////////////////////////////////////////////////////////// -#include "qplineSegs.h" +#include "lineSegs.h" //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Constructor +// Function: LineSegs::Constructor // Access: Public -// Description: Constructs a qpLineSegs object, which can be used to +// Description: Constructs a LineSegs object, which can be used to // create any number of disconnected lines or points of // various thicknesses and colors through the visible // scene. After creating the object, call move_to() and @@ -29,43 +29,43 @@ // create() to create a GeomNode which will render the // described path. //////////////////////////////////////////////////////////////////// -qpLineSegs:: -qpLineSegs(const string &name) : Namable(name) { +LineSegs:: +LineSegs(const string &name) : Namable(name) { _color.set(1.0f, 1.0f, 1.0f, 1.0f); _thick = 1.0f; } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::Destructor +// Function: LineSegs::Destructor // Access: Public //////////////////////////////////////////////////////////////////// -qpLineSegs:: -~qpLineSegs() { +LineSegs:: +~LineSegs() { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::reset +// Function: LineSegs::reset // Access: Public // Description: Removes any lines in progress and resets to the // initial empty state. //////////////////////////////////////////////////////////////////// -void qpLineSegs:: +void LineSegs:: reset() { _list.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::move_to +// Function: LineSegs::move_to // Access: Public // Description: Moves the pen to the given point without drawing a // line. When followed by draw_to(), this marks the // first point of a line segment; when followed by // move_to() or create(), this creates a single point. //////////////////////////////////////////////////////////////////// -void qpLineSegs:: +void LineSegs:: move_to(const LVecBase3f &v) { // We create a new SegmentList with the initial point in it. SegmentList segs; @@ -76,7 +76,7 @@ move_to(const LVecBase3f &v) { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::draw_to +// Function: LineSegs::draw_to // Access: Public // Description: Draws a line segment from the pen's last position // (the last call to move_to or draw_to) to the @@ -84,7 +84,7 @@ move_to(const LVecBase3f &v) { // tables; the actual drawing is performed when create() // is called. //////////////////////////////////////////////////////////////////// -void qpLineSegs:: +void LineSegs:: draw_to(const LVecBase3f &v) { if (_list.empty()) { // Let our first call to draw_to() be an implicit move_to(). @@ -101,24 +101,24 @@ draw_to(const LVecBase3f &v) { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::empty +// Function: LineSegs::empty // Access: Public // Description: Returns true if move_to() or draw_to() have not been // called since the last reset() or create(), false // otherwise. //////////////////////////////////////////////////////////////////// -bool qpLineSegs:: +bool LineSegs:: is_empty() { return _list.empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::get_current_position +// Function: LineSegs::get_current_position // Access: Public // Description: Returns the pen's current position. The next call to // draw_to() will draw a line segment from this point. //////////////////////////////////////////////////////////////////// -const Vertexf &qpLineSegs:: +const Vertexf &LineSegs:: get_current_position() { if (_list.empty()) { // Our pen isn't anywhere. We'll put it somewhere. @@ -129,7 +129,7 @@ get_current_position() { } //////////////////////////////////////////////////////////////////// -// Function: qpLineSegs::create +// Function: LineSegs::create // Access: Public // Description: Appends to an existing GeomNode a new Geom that // will render the series of line segments and points @@ -143,8 +143,8 @@ get_current_position() { // calls to set_vertex or set_vertex_color will be // visually correct. //////////////////////////////////////////////////////////////////// -qpGeomNode *qpLineSegs:: -create(qpGeomNode *previous, bool) { +GeomNode *LineSegs:: +create(GeomNode *previous, bool) { if (!_list.empty()) { _created_verts.clear(); _created_colors.clear(); diff --git a/panda/src/grutil/qplineSegs.h b/panda/src/grutil/lineSegs.h similarity index 87% rename from panda/src/grutil/qplineSegs.h rename to panda/src/grutil/lineSegs.h index 60ae8da668..649fe9bec6 100644 --- a/panda/src/grutil/qplineSegs.h +++ b/panda/src/grutil/lineSegs.h @@ -1,4 +1,4 @@ -// Filename: qplineSegs.h +// Filename: lineSegs.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpLINESEGS_H -#define qpLINESEGS_H +#ifndef LINESEGS_H +#define LINESEGS_H #include "pandabase.h" @@ -26,23 +26,23 @@ #include "geomPoint.h" #include "geomLine.h" #include "geomLinestrip.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "namable.h" #include "pvector.h" //////////////////////////////////////////////////////////////////// -// Class : qpLineSegs +// Class : LineSegs // Description : Encapsulates creation of a series of connected or // disconnected line segments or points, for drawing // paths or rays. This class doesn't attempt to be the // smartest it could possibly be; it's intended // primarily as a visualization and editing tool. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpLineSegs : public Namable { +class EXPCL_PANDA LineSegs : public Namable { PUBLISHED: - qpLineSegs(const string &name = "lines"); - ~qpLineSegs(); + LineSegs(const string &name = "lines"); + ~LineSegs(); void reset(); INLINE void set_color(float r, float g, float b, float a = 1.0f); @@ -58,8 +58,8 @@ PUBLISHED: const Vertexf &get_current_position(); bool is_empty(); - INLINE qpGeomNode *create(bool frame_accurate = false); - qpGeomNode *create(qpGeomNode *previous, bool frame_accurate = false); + INLINE GeomNode *create(bool frame_accurate = false); + GeomNode *create(GeomNode *previous, bool frame_accurate = false); // Functions to move the line vertices after they have been created. INLINE int get_num_vertices() const; @@ -95,6 +95,6 @@ private: PTA_Colorf _created_colors; }; -#include "qplineSegs.I" +#include "lineSegs.I" #endif diff --git a/panda/src/gsgbase/graphicsStateGuardianBase.h b/panda/src/gsgbase/graphicsStateGuardianBase.h index cd7e8d27c5..2f42cf3d18 100644 --- a/panda/src/gsgbase/graphicsStateGuardianBase.h +++ b/panda/src/gsgbase/graphicsStateGuardianBase.h @@ -31,7 +31,7 @@ class GraphicsWindow; class GeomContext; class GeomNodeContext; -class qpGeomNode; +class GeomNode; class Geom; class GeomPoint; class GeomLine; @@ -108,8 +108,8 @@ public: virtual void apply_texture(TextureContext *tc)=0; virtual void release_texture(TextureContext *tc)=0; - virtual GeomNodeContext *prepare_geom_node(qpGeomNode *node)=0; - virtual void draw_geom_node(qpGeomNode *node, const RenderState *state, + virtual GeomNodeContext *prepare_geom_node(GeomNode *node)=0; + virtual void draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc)=0; virtual void release_geom_node(GeomNodeContext *gnc)=0; diff --git a/panda/src/loader/Sources.pp b/panda/src/loader/Sources.pp index 79471922b0..bd6505527e 100644 --- a/panda/src/loader/Sources.pp +++ b/panda/src/loader/Sources.pp @@ -12,17 +12,17 @@ bamFile.I bamFile.h config_loader.h loader.I loader.h \ loaderFileType.h loaderFileTypeBam.h \ loaderFileTypeRegistry.h \ - qpmodelPool.I qpmodelPool.h + modelPool.I modelPool.h #define INCLUDED_SOURCES \ bamFile.cxx config_loader.cxx loader.cxx loaderFileType.cxx \ loaderFileTypeBam.cxx loaderFileTypeRegistry.cxx \ - qpmodelPool.cxx + modelPool.cxx #define INSTALL_HEADERS \ bamFile.I bamFile.h loader.I loader.h loaderFileType.h \ loaderFileTypeBam.h loaderFileTypeRegistry.h \ - qpmodelPool.I qpmodelPool.h + modelPool.I modelPool.h #define IGATESCAN all diff --git a/panda/src/loader/loader.I b/panda/src/loader/loader.I index 193162a5b4..54cf3eabe1 100644 --- a/panda/src/loader/loader.I +++ b/panda/src/loader/loader.I @@ -23,9 +23,9 @@ // Description: Loads the file immediately, waiting for it to complete. //////////////////////////////////////////////////////////////////// INLINE PT(PandaNode) Loader:: -qpload_sync(const Filename &filename) const { +load_sync(const Filename &filename) const { if (!_file_types_loaded) { load_file_types(); } - return qpload_file(filename); + return load_file(filename); } diff --git a/panda/src/loader/loader.cxx b/panda/src/loader/loader.cxx index a4a2d98da9..e38274620c 100644 --- a/panda/src/loader/loader.cxx +++ b/panda/src/loader/loader.cxx @@ -265,7 +265,7 @@ process_request() { while (!_token_board->_waiting.empty()) { PT(LoaderToken) tok = _token_board->_waiting.front(); _token_board->_waiting.pop_front(); - tok->_node = qpload_file(tok->_path); + tok->_node = load_file(tok->_path); if (tok->_node == NULL) { loader_cat.error() << "Loader::callback() - couldn't find file: " @@ -298,11 +298,11 @@ process_request() { // NULL if the file cannot be loaded. //////////////////////////////////////////////////////////////////// PT(PandaNode) Loader:: -qpload_file(const Filename &filename) const { +load_file(const Filename &filename) const { string extension = filename.get_extension(); if (extension.empty()) { - return qpload_unknown_file_type(filename); + return load_unknown_file_type(filename); } LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr(); @@ -331,7 +331,7 @@ qpload_file(const Filename &filename) const { << requested_filename << "\n"; } - PT(PandaNode) result = requested_type->qpload_file(requested_filename, true); + PT(PandaNode) result = requested_type->load_file(requested_filename, true); return result; } @@ -355,7 +355,7 @@ public: // any file type. //////////////////////////////////////////////////////////////////// PT(PandaNode) Loader:: -qpload_unknown_file_type(const Filename &filename) const { +load_unknown_file_type(const Filename &filename) const { typedef pvector Files; Files files; @@ -416,7 +416,7 @@ qpload_unknown_file_type(const Filename &filename) const { for (fi = files.begin(); fi != files.end(); ++fi) { const LoaderConsiderFile &consider = (*fi); - PT(PandaNode) result = consider._type->qpload_file(consider._path, false); + PT(PandaNode) result = consider._type->load_file(consider._path, false); if (result != (PandaNode *)NULL) { return result; } diff --git a/panda/src/loader/loader.h b/panda/src/loader/loader.h index ff24b7d980..d01d5b167f 100644 --- a/panda/src/loader/loader.h +++ b/panda/src/loader/loader.h @@ -40,7 +40,7 @@ PUBLISHED: void resolve_filename(Filename &filename) const; - INLINE PT(PandaNode) qpload_sync(const Filename &filename) const; + INLINE PT(PandaNode) load_sync(const Filename &filename) const; uint request_load(const Filename &filename, const string &event_name); bool check_load(uint id); @@ -51,8 +51,8 @@ private: static bool _file_types_loaded; virtual bool process_request(void); - PT(PandaNode) qpload_file(const Filename &filename) const; - PT(PandaNode) qpload_unknown_file_type(const Filename &filename) const; + PT(PandaNode) load_file(const Filename &filename) const; + PT(PandaNode) load_unknown_file_type(const Filename &filename) const; void resolve_unknown_file_type(Filename &filename) const; typedef TokenBoard LoaderTokenBoard; diff --git a/panda/src/loader/loaderFileType.cxx b/panda/src/loader/loaderFileType.cxx index d600ad435a..318844dfb1 100644 --- a/panda/src/loader/loaderFileType.cxx +++ b/panda/src/loader/loaderFileType.cxx @@ -58,7 +58,7 @@ resolve_filename(Filename &) const { // Description: //////////////////////////////////////////////////////////////////// PT(PandaNode) LoaderFileType:: -qpload_file(const Filename &path, bool report_errors) const { +load_file(const Filename &path, bool report_errors) const { loader_cat.error() << get_type() << " cannot read PandaNode objects.\n"; return NULL; diff --git a/panda/src/loader/loaderFileType.h b/panda/src/loader/loaderFileType.h index 7957898913..0c4a7a4f09 100644 --- a/panda/src/loader/loaderFileType.h +++ b/panda/src/loader/loaderFileType.h @@ -44,7 +44,7 @@ public: virtual string get_extension() const=0; virtual void resolve_filename(Filename &path) const; - virtual PT(PandaNode) qpload_file(const Filename &path, bool report_errors) const; + virtual PT(PandaNode) load_file(const Filename &path, bool report_errors) const; public: static TypeHandle get_class_type() { diff --git a/panda/src/loader/loaderFileTypeBam.cxx b/panda/src/loader/loaderFileTypeBam.cxx index 2347f0f9aa..300f2ad493 100644 --- a/panda/src/loader/loaderFileTypeBam.cxx +++ b/panda/src/loader/loaderFileTypeBam.cxx @@ -76,7 +76,7 @@ resolve_filename(Filename &path) const { // Description: //////////////////////////////////////////////////////////////////// PT(PandaNode) LoaderFileTypeBam:: -qpload_file(const Filename &path, bool report_errors) const { +load_file(const Filename &path, bool report_errors) const { BamFile bam_file; if (!bam_file.open_read(path, report_errors)) { return NULL; diff --git a/panda/src/loader/loaderFileTypeBam.h b/panda/src/loader/loaderFileTypeBam.h index 90f4324099..21fe1e5c4d 100644 --- a/panda/src/loader/loaderFileTypeBam.h +++ b/panda/src/loader/loaderFileTypeBam.h @@ -35,7 +35,7 @@ public: virtual string get_extension() const; virtual void resolve_filename(Filename &path) const; - virtual PT(PandaNode) qpload_file(const Filename &path, bool report_errors) const; + virtual PT(PandaNode) load_file(const Filename &path, bool report_errors) const; public: static TypeHandle get_class_type() { diff --git a/panda/src/loader/loader_composite2.cxx b/panda/src/loader/loader_composite2.cxx index 11086251a3..1631c114ff 100644 --- a/panda/src/loader/loader_composite2.cxx +++ b/panda/src/loader/loader_composite2.cxx @@ -1,5 +1,5 @@ -#include "qpmodelPool.cxx" +#include "modelPool.cxx" #include "loaderFileType.cxx" #include "loaderFileTypeBam.cxx" #include "loaderFileTypeRegistry.cxx" diff --git a/panda/src/loader/qpmodelPool.I b/panda/src/loader/modelPool.I similarity index 86% rename from panda/src/loader/qpmodelPool.I rename to panda/src/loader/modelPool.I index 34bc275874..ba441ea258 100644 --- a/panda/src/loader/qpmodelPool.I +++ b/panda/src/loader/modelPool.I @@ -1,4 +1,4 @@ -// Filename: qpmodelPool.I +// Filename: modelPool.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,18 +18,18 @@ //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::has_model +// Function: ModelPool::has_model // Access: Public, Static // Description: Returns true if the model has ever been loaded, // false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpModelPool:: +INLINE bool ModelPool:: has_model(const string &filename) { return get_ptr()->ns_has_model(filename); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::verify_model +// Function: ModelPool::verify_model // Access: Public, Static // Description: Loads the given filename up as a model, if it has // not already been loaded, and returns true to indicate @@ -38,13 +38,13 @@ has_model(const string &filename) { // to load_model() with the same model name will // return a valid Node pointer. //////////////////////////////////////////////////////////////////// -INLINE bool qpModelPool:: +INLINE bool ModelPool:: verify_model(const string &filename) { return load_model(filename) != (PandaNode *)NULL; } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::load_model +// Function: ModelPool::load_model // Access: Public, Static // Description: Loads the given filename up as a model, if it has // not already been loaded, and returns the new model. @@ -52,26 +52,26 @@ verify_model(const string &filename) { // loaded, returns that one instead. If the model // file cannot be found, returns NULL. //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpModelPool:: +INLINE PandaNode *ModelPool:: load_model(const string &filename) { return get_ptr()->ns_load_model(filename); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::add_model +// Function: ModelPool::add_model // Access: Public, Static // Description: Adds the indicated already-loaded model to the // pool. The model will always replace any // previously-loaded model in the pool that had the // same filename. //////////////////////////////////////////////////////////////////// -INLINE void qpModelPool:: +INLINE void ModelPool:: add_model(const string &filename, PandaNode *model) { get_ptr()->ns_add_model(filename, model); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::release_model +// Function: ModelPool::release_model // Access: Public, Static // Description: Removes the indicated model from the pool, // indicating it will never be loaded again; the model @@ -79,53 +79,53 @@ add_model(const string &filename, PandaNode *model) { // a reference count will be maintained on every model // every loaded, and models will never be freed. //////////////////////////////////////////////////////////////////// -INLINE void qpModelPool:: +INLINE void ModelPool:: release_model(const string &filename) { get_ptr()->ns_release_model(filename); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::release_all_models +// Function: ModelPool::release_all_models // Access: Public, Static // Description: Releases all models in the pool and restores the // pool to the empty state. //////////////////////////////////////////////////////////////////// -INLINE void qpModelPool:: +INLINE void ModelPool:: release_all_models() { get_ptr()->ns_release_all_models(); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::garbage_collect +// Function: ModelPool::garbage_collect // Access: Public, Static // Description: Releases only those models in the pool that have a // reference count of exactly 1; i.e. only those // models that are not being used outside of the pool. // Returns the number of models released. //////////////////////////////////////////////////////////////////// -INLINE int qpModelPool:: +INLINE int ModelPool:: garbage_collect() { return get_ptr()->ns_garbage_collect(); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::list_contents +// Function: ModelPool::list_contents // Access: Public, Static // Description: Lists the contents of the model pool to the // indicated output stream. //////////////////////////////////////////////////////////////////// -INLINE void qpModelPool:: +INLINE void ModelPool:: list_contents(ostream &out) { get_ptr()->ns_list_contents(out); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::Constructor +// Function: ModelPool::Constructor // Access: Private // Description: The constructor is not intended to be called -// directly; there's only supposed to be one qpModelPool +// directly; there's only supposed to be one ModelPool // in the universe and it constructs itself. //////////////////////////////////////////////////////////////////// -INLINE qpModelPool:: -qpModelPool() { +INLINE ModelPool:: +ModelPool() { } diff --git a/panda/src/loader/qpmodelPool.cxx b/panda/src/loader/modelPool.cxx similarity index 83% rename from panda/src/loader/qpmodelPool.cxx rename to panda/src/loader/modelPool.cxx index 82f296b1d8..593ca8ccbf 100644 --- a/panda/src/loader/qpmodelPool.cxx +++ b/panda/src/loader/modelPool.cxx @@ -1,4 +1,4 @@ -// Filename: qpmodelPool.cxx +// Filename: modelPool.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,21 +16,21 @@ // //////////////////////////////////////////////////////////////////// -#include "qpmodelPool.h" +#include "modelPool.h" #include "loader.h" #include "config_loader.h" -qpModelPool *qpModelPool::_global_ptr = (qpModelPool *)NULL; +ModelPool *ModelPool::_global_ptr = (ModelPool *)NULL; -static Loader _qpmodel_loader; +static Loader _model_loader; //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_has_model +// Function: ModelPool::ns_has_model // Access: Private // Description: The nonstatic implementation of has_model(). //////////////////////////////////////////////////////////////////// -bool qpModelPool:: +bool ModelPool:: ns_has_model(const string &filename) { Models::const_iterator ti; ti = _models.find(filename); @@ -43,11 +43,11 @@ ns_has_model(const string &filename) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_load_model +// Function: ModelPool::ns_load_model // Access: Private // Description: The nonstatic implementation of load_model(). //////////////////////////////////////////////////////////////////// -PandaNode *qpModelPool:: +PandaNode *ModelPool:: ns_load_model(const string &filename) { Models::const_iterator ti; ti = _models.find(filename); @@ -58,7 +58,7 @@ ns_load_model(const string &filename) { loader_cat.info() << "Loading model " << filename << "\n"; - PT(PandaNode) node = _qpmodel_loader.qpload_sync(filename); + PT(PandaNode) node = _model_loader.load_sync(filename); if (node.is_null()) { // This model was not found. return (PandaNode *)NULL; @@ -69,22 +69,22 @@ ns_load_model(const string &filename) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_add_model +// Function: ModelPool::ns_add_model // Access: Private // Description: The nonstatic implementation of add_model(). //////////////////////////////////////////////////////////////////// -void qpModelPool:: +void ModelPool:: ns_add_model(const string &filename, PandaNode *model) { // We blow away whatever model was there previously, if any. _models[filename] = model; } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_release_model +// Function: ModelPool::ns_release_model // Access: Private // Description: The nonstatic implementation of release_model(). //////////////////////////////////////////////////////////////////// -void qpModelPool:: +void ModelPool:: ns_release_model(const string &filename) { Models::iterator ti; ti = _models.find(filename); @@ -94,21 +94,21 @@ ns_release_model(const string &filename) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_release_all_models +// Function: ModelPool::ns_release_all_models // Access: Private // Description: The nonstatic implementation of release_all_models(). //////////////////////////////////////////////////////////////////// -void qpModelPool:: +void ModelPool:: ns_release_all_models() { _models.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_garbage_collect +// Function: ModelPool::ns_garbage_collect // Access: Private // Description: The nonstatic implementation of garbage_collect(). //////////////////////////////////////////////////////////////////// -int qpModelPool:: +int ModelPool:: ns_garbage_collect() { int num_released = 0; Models new_set; @@ -132,11 +132,11 @@ ns_garbage_collect() { } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::ns_list_contents +// Function: ModelPool::ns_list_contents // Access: Private // Description: The nonstatic implementation of list_contents(). //////////////////////////////////////////////////////////////////// -void qpModelPool:: +void ModelPool:: ns_list_contents(ostream &out) { out << _models.size() << " models:\n"; Models::iterator ti; @@ -147,15 +147,15 @@ ns_list_contents(ostream &out) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelPool::get_ptr +// Function: ModelPool::get_ptr // Access: Private, Static // Description: Initializes and/or returns the global pointer to the -// one qpModelPool object in the system. +// one ModelPool object in the system. //////////////////////////////////////////////////////////////////// -qpModelPool *qpModelPool:: +ModelPool *ModelPool:: get_ptr() { - if (_global_ptr == (qpModelPool *)NULL) { - _global_ptr = new qpModelPool; + if (_global_ptr == (ModelPool *)NULL) { + _global_ptr = new ModelPool; } return _global_ptr; } diff --git a/panda/src/loader/qpmodelPool.h b/panda/src/loader/modelPool.h similarity index 92% rename from panda/src/loader/qpmodelPool.h rename to panda/src/loader/modelPool.h index 617b1e0426..7d8f01032e 100644 --- a/panda/src/loader/qpmodelPool.h +++ b/panda/src/loader/modelPool.h @@ -1,4 +1,4 @@ -// Filename: qpmodelPool.h +// Filename: modelPool.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpMODELPOOL_H -#define qpMODELPOOL_H +#ifndef MODELPOOL_H +#define MODELPOOL_H #include "pandabase.h" @@ -46,7 +46,7 @@ // This does not presently support asynchronous loading, // although it wouldn't be *too* difficult to add. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpModelPool { +class EXPCL_PANDA ModelPool { PUBLISHED: INLINE static bool has_model(const string &filename); INLINE static bool verify_model(const string &filename); @@ -61,7 +61,7 @@ PUBLISHED: INLINE static void list_contents(ostream &out); private: - INLINE qpModelPool(); + INLINE ModelPool(); bool ns_has_model(const string &filename); PandaNode *ns_load_model(const string &filename); @@ -71,14 +71,14 @@ private: int ns_garbage_collect(); void ns_list_contents(ostream &out); - static qpModelPool *get_ptr(); + static ModelPool *get_ptr(); - static qpModelPool *_global_ptr; + static ModelPool *_global_ptr; typedef pmap Models; Models _models; }; -#include "qpmodelPool.I" +#include "modelPool.I" #endif diff --git a/panda/src/parametrics/nurbsCurveDrawer.h b/panda/src/parametrics/nurbsCurveDrawer.h index 1ddd0dc8c1..e6ab82254c 100644 --- a/panda/src/parametrics/nurbsCurveDrawer.h +++ b/panda/src/parametrics/nurbsCurveDrawer.h @@ -22,7 +22,7 @@ #include "pandabase.h" #include "parametricCurveDrawer.h" -#include "qplineSegs.h" +#include "lineSegs.h" //////////////////////////////////////////////////////////////////// @@ -56,7 +56,7 @@ PUBLISHED: protected: LVecBase3f _cv_color, _hull_color, _knot_color; int _num_cvs, _num_hull, _num_knots; - qpLineSegs _hull, _knots, _cvs; + LineSegs _hull, _knots, _cvs; pvector _knotnums; bool _show_cvs, _show_hull, _show_knots; diff --git a/panda/src/parametrics/parametricCurveDrawer.cxx b/panda/src/parametrics/parametricCurveDrawer.cxx index 49eb8490f2..95f7ef303a 100644 --- a/panda/src/parametrics/parametricCurveDrawer.cxx +++ b/panda/src/parametrics/parametricCurveDrawer.cxx @@ -36,7 +36,7 @@ ParametricCurveDrawer() { _num_segs = 100.0; _num_ticks = 0.0f; _frame_accurate = false; - _geom_node = new qpGeomNode("pcd"); + _geom_node = new GeomNode("pcd"); _drawn = false; } @@ -128,7 +128,7 @@ get_curves() { // the GeomNode, and the GeomNode will be emptied when the // drawer destructs. Also see detach_geom_node(). //////////////////////////////////////////////////////////////////// -qpGeomNode *ParametricCurveDrawer:: +GeomNode *ParametricCurveDrawer:: get_geom_node() { return _geom_node; } @@ -144,13 +144,13 @@ get_geom_node() { // will return this new GeomNode which will be empty until // the next call to draw(). //////////////////////////////////////////////////////////////////// -qpGeomNode *ParametricCurveDrawer:: +GeomNode *ParametricCurveDrawer:: detach_geom_node() { if (!_drawn) { draw(); } - PT(qpGeomNode) g = _geom_node; - _geom_node = new qpGeomNode("pcd"); + PT(GeomNode) g = _geom_node; + _geom_node = new GeomNode("pcd"); _drawn = false; return g; } diff --git a/panda/src/parametrics/parametricCurveDrawer.h b/panda/src/parametrics/parametricCurveDrawer.h index 17fff227b0..d229fe8a77 100644 --- a/panda/src/parametrics/parametricCurveDrawer.h +++ b/panda/src/parametrics/parametricCurveDrawer.h @@ -21,7 +21,7 @@ #include "parametricCurveCollection.h" -#include "qplineSegs.h" +#include "lineSegs.h" #include "pandaNode.h" #include "typedObject.h" @@ -41,8 +41,8 @@ PUBLISHED: void clear_curves(); ParametricCurveCollection *get_curves(); - qpGeomNode *get_geom_node(); - qpGeomNode *detach_geom_node(); + GeomNode *get_geom_node(); + GeomNode *detach_geom_node(); void set_num_segs(float num_segs); float get_num_segs() const; @@ -70,13 +70,13 @@ private: static void get_tick_marks(const LVecBase3f &tangent, LVecBase3f &t1, LVecBase3f &t2); protected: - PT(qpGeomNode) _geom_node; + PT(GeomNode) _geom_node; PT(ParametricCurveCollection) _curves; bool _frame_accurate; private: float _num_segs; - qpLineSegs _lines, _ticks; + LineSegs _lines, _ticks; bool _drawn; float _num_ticks; float _tick_scale; diff --git a/panda/src/particlesystem/baseParticleRenderer.I b/panda/src/particlesystem/baseParticleRenderer.I index 84ed13ede5..5949149217 100644 --- a/panda/src/particlesystem/baseParticleRenderer.I +++ b/panda/src/particlesystem/baseParticleRenderer.I @@ -21,7 +21,7 @@ // Class : Public // Description : Query the geomnode pointer //////////////////////////////////////////////////////////////////// -INLINE qpGeomNode *BaseParticleRenderer:: +INLINE GeomNode *BaseParticleRenderer:: get_render_node(void) const { return _render_node; } diff --git a/panda/src/particlesystem/baseParticleRenderer.cxx b/panda/src/particlesystem/baseParticleRenderer.cxx index 5a4d537128..5b7d6ff6a5 100644 --- a/panda/src/particlesystem/baseParticleRenderer.cxx +++ b/panda/src/particlesystem/baseParticleRenderer.cxx @@ -29,7 +29,7 @@ BaseParticleRenderer:: BaseParticleRenderer(ParticleRendererAlphaMode alpha_mode) : _alpha_mode(PR_NOT_INITIALIZED_YET) { - _render_node = new qpGeomNode("BaseParticleRenderer render node"); + _render_node = new GeomNode("BaseParticleRenderer render node"); _user_alpha = 1.0f; @@ -44,7 +44,7 @@ BaseParticleRenderer(ParticleRendererAlphaMode alpha_mode) : BaseParticleRenderer:: BaseParticleRenderer(const BaseParticleRenderer& copy) : _alpha_mode(PR_ALPHA_NONE) { - _render_node = new qpGeomNode("BaseParticleRenderer render node"); + _render_node = new GeomNode("BaseParticleRenderer render node"); _user_alpha = copy._user_alpha; diff --git a/panda/src/particlesystem/baseParticleRenderer.h b/panda/src/particlesystem/baseParticleRenderer.h index f2e84ed039..4692aa7970 100644 --- a/panda/src/particlesystem/baseParticleRenderer.h +++ b/panda/src/particlesystem/baseParticleRenderer.h @@ -23,7 +23,7 @@ #include "referenceCount.h" #include "physicsObject.h" #include "renderState.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "particleCommonFuncs.h" #include "baseParticle.h" @@ -36,7 +36,7 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS BaseParticleRenderer : public ReferenceCount { private: - PT(qpGeomNode) _render_node; + PT(GeomNode) _render_node; float _user_alpha; @@ -72,7 +72,7 @@ PUBLISHED: virtual ~BaseParticleRenderer(void); - INLINE qpGeomNode *get_render_node(void) const; + INLINE GeomNode *get_render_node(void) const; INLINE void set_alpha_mode(ParticleRendererAlphaMode am); INLINE ParticleRendererAlphaMode get_alpha_mode(void) const; diff --git a/panda/src/particlesystem/lineParticleRenderer.cxx b/panda/src/particlesystem/lineParticleRenderer.cxx index a4e0834544..ae3db34f09 100644 --- a/panda/src/particlesystem/lineParticleRenderer.cxx +++ b/panda/src/particlesystem/lineParticleRenderer.cxx @@ -138,7 +138,7 @@ void LineParticleRenderer:: init_geoms(void) { _line_primitive->set_num_prims(0); - qpGeomNode *render_node = get_render_node(); + GeomNode *render_node = get_render_node(); render_node->remove_all_geoms(); render_node->add_geom(_line_primitive, _render_state); } diff --git a/panda/src/particlesystem/particleSystem.cxx b/panda/src/particlesystem/particleSystem.cxx index a6816177c4..5ca4994921 100644 --- a/panda/src/particlesystem/particleSystem.cxx +++ b/panda/src/particlesystem/particleSystem.cxx @@ -25,7 +25,7 @@ #include "physicalNode.h" #include "nearly_zero.h" #include "transformState.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "config_particlesystem.h" #include "particleSystem.h" @@ -170,14 +170,14 @@ birth_particle(void) { // get the location of the new particle. LPoint3f new_pos, world_pos; LVector3f new_vel; - qpGeomNode *render_node; + GeomNode *render_node; _emitter->generate(new_pos, new_vel); render_node = _renderer->get_render_node(); // go from birth space to render space - qpNodePath physical_np(get_physical_node()); - qpNodePath render_np(render_node); + NodePath physical_np(get_physical_node()); + NodePath render_np(render_node); const LMatrix4f &birth_to_render_xform = physical_np.get_mat(render_np); world_pos = new_pos * birth_to_render_xform; @@ -268,8 +268,8 @@ spawn_child_system(BaseParticle *bp) { // down to the new child. parent->add_child(new_pn); - qpNodePath parent_np(parent); - qpNodePath physical_np(get_physical_node()); + NodePath parent_np(parent); + NodePath physical_np(get_physical_node()); const LMatrix4f &old_system_to_parent_xform = physical_np.get_mat(parent_np); diff --git a/panda/src/particlesystem/pointParticleRenderer.cxx b/panda/src/particlesystem/pointParticleRenderer.cxx index be56e9bb4b..6f624b0693 100644 --- a/panda/src/particlesystem/pointParticleRenderer.cxx +++ b/panda/src/particlesystem/pointParticleRenderer.cxx @@ -18,7 +18,7 @@ #include "pointParticleRenderer.h" #include "boundingSphere.h" -#include "qpgeomNode.h" +#include "geomNode.h" //////////////////////////////////////////////////////////////////// // Function : PointParticleRenderer @@ -116,7 +116,7 @@ init_geoms(void) { _point_primitive->set_num_prims(0); _point_primitive->set_size(_point_size); - qpGeomNode *render_node = get_render_node(); + GeomNode *render_node = get_render_node(); render_node->remove_all_geoms(); render_node->add_geom(_point_primitive, _render_state); } diff --git a/panda/src/particlesystem/sparkleParticleRenderer.cxx b/panda/src/particlesystem/sparkleParticleRenderer.cxx index aae2ad7903..6933c7812d 100644 --- a/panda/src/particlesystem/sparkleParticleRenderer.cxx +++ b/panda/src/particlesystem/sparkleParticleRenderer.cxx @@ -19,7 +19,7 @@ #include "sparkleParticleRenderer.h" #include "boundingSphere.h" -#include "qpgeomNode.h" +#include "geomNode.h" //////////////////////////////////////////////////////////////////// // Function : SparkleParticleRenderer @@ -147,7 +147,7 @@ void SparkleParticleRenderer:: init_geoms(void) { _line_primitive->set_num_prims(0); - qpGeomNode *render_node = get_render_node(); + GeomNode *render_node = get_render_node(); render_node->remove_all_geoms(); render_node->add_geom(_line_primitive, _render_state); } diff --git a/panda/src/particlesystem/spriteParticleRenderer.cxx b/panda/src/particlesystem/spriteParticleRenderer.cxx index ab2f8cc1c3..aed2820816 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.cxx +++ b/panda/src/particlesystem/spriteParticleRenderer.cxx @@ -20,7 +20,7 @@ #include "boundingSphere.h" #include "geom.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "dcast.h" //////////////////////////////////////////////////////////////////// @@ -97,12 +97,12 @@ make_copy(void) { // Texture and UV range from the GeomNode. //////////////////////////////////////////////////////////////////// void SpriteParticleRenderer:: -set_from_node(const qpNodePath &node_path) { +set_from_node(const NodePath &node_path) { nassertv(!node_path.is_empty()); // The bottom node must be a GeomNode. If it is not, find the first // GeomNode beneath it. - qpNodePath geom_node_path = node_path; + NodePath geom_node_path = node_path; if (!geom_node_path.node()->is_geom_node()) { geom_node_path = node_path.find("**/+GeomNode"); if (geom_node_path.is_empty()) { @@ -111,7 +111,7 @@ set_from_node(const qpNodePath &node_path) { return; } } - qpGeomNode *gnode = DCAST(qpGeomNode, geom_node_path.node()); + GeomNode *gnode = DCAST(GeomNode, geom_node_path.node()); // Get the texture off the node. We'll take just the first texture. Texture *tex = geom_node_path.find_texture("*"); @@ -234,7 +234,7 @@ void SpriteParticleRenderer:: init_geoms(void) { _sprite_primitive->set_num_prims(0); - qpGeomNode *render_node = get_render_node(); + GeomNode *render_node = get_render_node(); render_node->remove_all_geoms(); render_node->add_geom(_sprite_primitive, _render_state); } diff --git a/panda/src/particlesystem/spriteParticleRenderer.h b/panda/src/particlesystem/spriteParticleRenderer.h index 9849f09fbc..1cbf00a8be 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.h +++ b/panda/src/particlesystem/spriteParticleRenderer.h @@ -30,7 +30,7 @@ #include "baseParticleRenderer.h" #include "baseParticle.h" -class qpNodePath; +class NodePath; //////////////////////////////////////////////////////////////////// // Class : SpriteParticleRenderer @@ -88,7 +88,7 @@ PUBLISHED: INLINE SourceType get_source_type() const; - void set_from_node(const qpNodePath &node_path); + void set_from_node(const NodePath &node_path); INLINE void set_texture(Texture *tex); INLINE void set_ll_uv(const TexCoordf &ll_uv); diff --git a/panda/src/pgraph/Sources.pp b/panda/src/pgraph/Sources.pp index f4ba6bcf50..238b81d5e8 100644 --- a/panda/src/pgraph/Sources.pp +++ b/panda/src/pgraph/Sources.pp @@ -9,7 +9,7 @@ ambientLight.I ambientLight.h \ billboardEffect.I billboardEffect.h \ binCullHandler.I binCullHandler.h \ - qpcamera.I qpcamera.h \ + camera.I camera.h \ colorAttrib.I colorAttrib.h \ colorBlendAttrib.I colorBlendAttrib.h \ colorScaleAttrib.I colorScaleAttrib.h \ @@ -23,7 +23,7 @@ cullFaceAttrib.I cullFaceAttrib.h \ cullHandler.I cullHandler.h \ cullResult.I cullResult.h \ - qpcullTraverser.I qpcullTraverser.h \ + cullTraverser.I cullTraverser.h \ cullTraverserData.I cullTraverserData.h \ cullableObject.I cullableObject.h \ decalEffect.I decalEffect.h \ @@ -32,26 +32,26 @@ depthWriteAttrib.I depthWriteAttrib.h \ directionalLight.I directionalLight.h \ drawCullHandler.I drawCullHandler.h \ - qpfindApproxLevel.I qpfindApproxLevel.h \ - qpfindApproxLevelEntry.I qpfindApproxLevelEntry.h \ - qpfindApproxPath.I qpfindApproxPath.h \ - qpfog.I qpfog.h \ + findApproxLevel.I findApproxLevel.h \ + findApproxLevelEntry.I findApproxLevelEntry.h \ + findApproxPath.I findApproxPath.h \ + fog.I fog.h \ fogAttrib.I fogAttrib.h \ - qpgeomNode.I qpgeomNode.h \ - qpgeomTransformer.I qpgeomTransformer.h \ - qplensNode.I qplensNode.h \ + geomNode.I geomNode.h \ + geomTransformer.I geomTransformer.h \ + lensNode.I lensNode.h \ light.I light.h \ lightAttrib.I lightAttrib.h \ lightLensNode.I lightLensNode.h \ lightNode.I lightNode.h \ - qplodNode.I qplodNode.h \ + lodNode.I lodNode.h \ materialAttrib.I materialAttrib.h \ - qpmodelNode.I qpmodelNode.h \ - qpmodelRoot.I qpmodelRoot.h \ - qpnodePath.I qpnodePath.h qpnodePath.cxx \ - qpnodePathCollection.I qpnodePathCollection.h \ - qpnodePathComponent.I qpnodePathComponent.h \ - qpnodePathLerps.h \ + modelNode.I modelNode.h \ + modelRoot.I modelRoot.h \ + nodePath.I nodePath.h nodePath.cxx \ + nodePathCollection.I nodePathCollection.h \ + nodePathComponent.I nodePathComponent.h \ + nodePathLerps.h \ pandaNode.I pandaNode.h \ pointLight.I pointLight.h \ renderAttrib.I renderAttrib.h \ @@ -60,10 +60,10 @@ renderModeAttrib.I renderModeAttrib.h \ renderState.I renderState.h \ sceneGraphAnalyzer.h \ - qpsceneGraphReducer.I qpsceneGraphReducer.h \ + sceneGraphReducer.I sceneGraphReducer.h \ sceneSetup.I sceneSetup.h \ selectiveChildNode.I selectiveChildNode.h \ - qpsequenceNode.I qpsequenceNode.h \ + sequenceNode.I sequenceNode.h \ showBoundsEffect.I showBoundsEffect.h \ spotlight.I spotlight.h \ texMatrixAttrib.I texMatrixAttrib.h \ @@ -79,7 +79,7 @@ ambientLight.cxx \ billboardEffect.cxx \ binCullHandler.cxx \ - qpcamera.cxx \ + camera.cxx \ colorAttrib.cxx \ colorBlendAttrib.cxx \ colorScaleAttrib.cxx \ @@ -93,7 +93,7 @@ cullFaceAttrib.cxx \ cullHandler.cxx \ cullResult.cxx \ - qpcullTraverser.cxx \ + cullTraverser.cxx \ cullTraverserData.cxx \ cullableObject.cxx \ decalEffect.cxx \ @@ -102,26 +102,26 @@ depthWriteAttrib.cxx \ directionalLight.cxx \ drawCullHandler.cxx \ - qpfindApproxLevel.cxx \ - qpfindApproxLevelEntry.cxx \ - qpfindApproxPath.cxx \ - qpfog.cxx \ + findApproxLevel.cxx \ + findApproxLevelEntry.cxx \ + findApproxPath.cxx \ + fog.cxx \ fogAttrib.cxx \ - qpgeomNode.cxx \ - qpgeomTransformer.cxx \ - qplensNode.cxx \ + geomNode.cxx \ + geomTransformer.cxx \ + lensNode.cxx \ light.cxx \ lightAttrib.cxx \ lightLensNode.cxx \ lightNode.cxx \ - qplodNode.cxx \ + lodNode.cxx \ materialAttrib.cxx \ - qpmodelNode.cxx \ - qpmodelRoot.cxx \ - qpnodePath.cxx \ - qpnodePathCollection.cxx \ - qpnodePathComponent.cxx \ - qpnodePathLerps.cxx \ + modelNode.cxx \ + modelRoot.cxx \ + nodePath.cxx \ + nodePathCollection.cxx \ + nodePathComponent.cxx \ + nodePathLerps.cxx \ pandaNode.cxx \ pointLight.cxx \ renderAttrib.cxx \ @@ -130,10 +130,10 @@ renderModeAttrib.cxx \ renderState.cxx \ sceneGraphAnalyzer.cxx \ - qpsceneGraphReducer.cxx \ + sceneGraphReducer.cxx \ sceneSetup.cxx \ selectiveChildNode.cxx \ - qpsequenceNode.cxx \ + sequenceNode.cxx \ showBoundsEffect.cxx \ spotlight.cxx \ texMatrixAttrib.cxx \ @@ -154,7 +154,7 @@ ambientLight.I ambientLight.h \ billboardEffect.I billboardEffect.h \ binCullHandler.I binCullHandler.h \ - qpcamera.I qpcamera.h \ + camera.I camera.h \ colorAttrib.I colorAttrib.h \ colorBlendAttrib.I colorBlendAttrib.h \ colorScaleAttrib.I colorScaleAttrib.h \ @@ -168,7 +168,7 @@ cullFaceAttrib.I cullFaceAttrib.h \ cullHandler.I cullHandler.h \ cullResult.I cullResult.h \ - qpcullTraverser.I qpcullTraverser.h \ + cullTraverser.I cullTraverser.h \ cullTraverserData.I cullTraverserData.h \ cullableObject.I cullableObject.h \ decalEffect.I decalEffect.h \ @@ -177,23 +177,23 @@ depthWriteAttrib.I depthWriteAttrib.h \ directionalLight.I directionalLight.h \ drawCullHandler.I drawCullHandler.h \ - qpfog.I qpfog.h \ + fog.I fog.h \ fogAttrib.I fogAttrib.h \ - qpgeomNode.I qpgeomNode.h \ - qpgeomTransformer.I qpgeomTransformer.h \ - qplensNode.I qplensNode.h \ + geomNode.I geomNode.h \ + geomTransformer.I geomTransformer.h \ + lensNode.I lensNode.h \ light.I light.h \ lightAttrib.I lightAttrib.h \ lightLensNode.I lightLensNode.h \ lightNode.I lightNode.h \ - qplodNode.I qplodNode.h \ + lodNode.I lodNode.h \ materialAttrib.I materialAttrib.h \ - qpmodelNode.I qpmodelNode.h \ - qpmodelRoot.I qpmodelRoot.h \ - qpnodePath.I qpnodePath.h \ - qpnodePathCollection.I qpnodePathCollection.h \ - qpnodePathComponent.I qpnodePathComponent.h \ - qpnodePathLerps.h \ + modelNode.I modelNode.h \ + modelRoot.I modelRoot.h \ + nodePath.I nodePath.h \ + nodePathCollection.I nodePathCollection.h \ + nodePathComponent.I nodePathComponent.h \ + nodePathLerps.h \ pandaNode.I pandaNode.h \ pointLight.I pointLight.h \ renderAttrib.I renderAttrib.h \ @@ -202,10 +202,10 @@ renderModeAttrib.I renderModeAttrib.h \ renderState.I renderState.h \ sceneGraphAnalyzer.h \ - qpsceneGraphReducer.I qpsceneGraphReducer.h \ + sceneGraphReducer.I sceneGraphReducer.h \ sceneSetup.I sceneSetup.h \ selectiveChildNode.I selectiveChildNode.h \ - qpsequenceNode.I qpsequenceNode.h \ + sequenceNode.I sequenceNode.h \ showBoundsEffect.I showBoundsEffect.h \ spotlight.I spotlight.h \ texMatrixAttrib.I texMatrixAttrib.h \ @@ -217,9 +217,9 @@ workingNodePath.I workingNodePath.h // No need to install these. -// qpfindApproxLevel.I qpfindApproxLevel.h \ -// qpfindApproxLevelEntry.I qpfindApproxLevelEntry.h \ -// qpfindApproxPath.I qpfindApproxPath.h \ +// findApproxLevel.I findApproxLevel.h \ +// findApproxLevelEntry.I findApproxLevelEntry.h \ +// findApproxPath.I findApproxPath.h \ #define IGATESCAN all diff --git a/panda/src/pgraph/billboardEffect.I b/panda/src/pgraph/billboardEffect.I index 8322561178..9ee2cc2bf6 100644 --- a/panda/src/pgraph/billboardEffect.I +++ b/panda/src/pgraph/billboardEffect.I @@ -37,7 +37,7 @@ BillboardEffect() { INLINE CPT(RenderEffect) BillboardEffect:: make_axis() { return make(LVector3f::up(), false, true, - 0.0f, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + 0.0f, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); } //////////////////////////////////////////////////////////////////// @@ -49,7 +49,7 @@ make_axis() { INLINE CPT(RenderEffect) BillboardEffect:: make_point_eye() { return make(LVector3f::up(), true, false, - 0.0f, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + 0.0f, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); } //////////////////////////////////////////////////////////////////// @@ -61,7 +61,7 @@ make_point_eye() { INLINE CPT(RenderEffect) BillboardEffect:: make_point_world() { return make(LVector3f::up(), false, false, - 0.0f, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + 0.0f, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); } //////////////////////////////////////////////////////////////////// @@ -73,7 +73,7 @@ make_point_world() { // particularly useful and isn't normally created or // stored in the graph; it might be implicitly // discovered as the result of a -// qpNodePath::get_rel_state(). +// NodePath::get_rel_state(). //////////////////////////////////////////////////////////////////// INLINE bool BillboardEffect:: is_off() const { @@ -135,7 +135,7 @@ get_offset() const { // will rotate towards the current camera node, wherever // that might be. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &BillboardEffect:: +INLINE const NodePath &BillboardEffect:: get_look_at() const { return _look_at; } diff --git a/panda/src/pgraph/billboardEffect.cxx b/panda/src/pgraph/billboardEffect.cxx index 099044f50b..762db81406 100644 --- a/panda/src/pgraph/billboardEffect.cxx +++ b/panda/src/pgraph/billboardEffect.cxx @@ -33,7 +33,7 @@ TypeHandle BillboardEffect::_type_handle; //////////////////////////////////////////////////////////////////// CPT(RenderEffect) BillboardEffect:: make(const LVector3f &up_vector, bool eye_relative, - bool axial_rotate, float offset, const qpNodePath &look_at, + bool axial_rotate, float offset, const NodePath &look_at, const LPoint3f &look_at_point) { BillboardEffect *effect = new BillboardEffect; effect->_up_vector = up_vector; @@ -240,7 +240,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { dg.add_float32(_offset); _look_at_point.write_datagram(dg); - // *** We don't write out the _look_at qpNodePath right now. Maybe + // *** We don't write out the _look_at NodePath right now. Maybe // we should. } diff --git a/panda/src/pgraph/billboardEffect.h b/panda/src/pgraph/billboardEffect.h index 0ffa3e96bc..fa5ff9bf05 100644 --- a/panda/src/pgraph/billboardEffect.h +++ b/panda/src/pgraph/billboardEffect.h @@ -23,7 +23,7 @@ #include "renderEffect.h" #include "luse.h" -#include "qpnodePath.h" +#include "nodePath.h" //////////////////////////////////////////////////////////////////// // Class : BillboardEffect @@ -40,7 +40,7 @@ PUBLISHED: bool eye_relative, bool axial_rotate, float offset, - const qpNodePath &look_at, + const NodePath &look_at, const LPoint3f &look_at_point); INLINE static CPT(RenderEffect) make_axis(); INLINE static CPT(RenderEffect) make_point_eye(); @@ -51,7 +51,7 @@ PUBLISHED: INLINE bool get_eye_relative() const; INLINE bool get_axial_rotate() const; INLINE float get_offset() const; - INLINE const qpNodePath &get_look_at() const; + INLINE const NodePath &get_look_at() const; INLINE const LPoint3f &get_look_at_point() const; public: @@ -71,7 +71,7 @@ private: bool _eye_relative; bool _axial_rotate; float _offset; - qpNodePath _look_at; + NodePath _look_at; LPoint3f _look_at_point; public: diff --git a/panda/src/pgraph/qpcamera.I b/panda/src/pgraph/camera.I similarity index 86% rename from panda/src/pgraph/qpcamera.I rename to panda/src/pgraph/camera.I index 974555dd24..d042900f9d 100644 --- a/panda/src/pgraph/qpcamera.I +++ b/panda/src/pgraph/camera.I @@ -1,4 +1,4 @@ -// Filename: qpcamera.I +// Filename: camera.I // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,76 +18,76 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCamera::set_active +// Function: Camera::set_active // Access: Published // Description: Sets the active flag on the camera. When the camera // is not active, nothing will be rendered. //////////////////////////////////////////////////////////////////// -INLINE void qpCamera:: +INLINE void Camera:: set_active(bool active) { _active = active; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::is_active +// Function: Camera::is_active // Access: Published // Description: Returns the current setting of the active flag on the // camera. //////////////////////////////////////////////////////////////////// -INLINE bool qpCamera:: +INLINE bool Camera:: is_active() const { return _active; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::set_scene +// Function: Camera::set_scene // Access: Published // Description: Sets the scene that will be rendered by the camera. // This is normally the root node of a scene graph, // typically a node called 'render', although it could // represent the root of any subgraph. //////////////////////////////////////////////////////////////////// -INLINE void qpCamera:: -set_scene(const qpNodePath &scene) { +INLINE void Camera:: +set_scene(const NodePath &scene) { _scene = scene; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::get_scene +// Function: Camera::get_scene // Access: Published // Description: Returns the scene that will be rendered by the // camera. See set_scene(). //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &qpCamera:: +INLINE const NodePath &Camera:: get_scene() const { return _scene; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::get_num_display_regions +// Function: Camera::get_num_display_regions // Access: Published // Description: Returns the number of display regions associated with // the camera. //////////////////////////////////////////////////////////////////// -INLINE int qpCamera:: +INLINE int Camera:: get_num_display_regions() const { return _display_regions.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::get_display_region +// Function: Camera::get_display_region // Access: Published // Description: Returns the nth display region associated with the // camera. //////////////////////////////////////////////////////////////////// -INLINE DisplayRegion *qpCamera:: +INLINE DisplayRegion *Camera:: get_display_region(int n) const { nassertr(n >= 0 && n < (int)_display_regions.size(), (DisplayRegion *)NULL); return _display_regions[n]; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::set_camera_mask +// Function: Camera::set_camera_mask // Access: Published // Description: Changes the set of bits that represent the subset of // the scene graph the camera will render. @@ -99,19 +99,19 @@ get_display_region(int n) const { // scene graph from different cameras that are otherwise // viewing the same scene. //////////////////////////////////////////////////////////////////// -INLINE void qpCamera:: +INLINE void Camera:: set_camera_mask(DrawMask mask) { _camera_mask = mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::get_camera_mask +// Function: Camera::get_camera_mask // Access: Published // Description: Returns the set of bits that represent the subset of // the scene graph the camera will render. See // set_camera_mask(). //////////////////////////////////////////////////////////////////// -INLINE DrawMask qpCamera:: +INLINE DrawMask Camera:: get_camera_mask() const { return _camera_mask; } diff --git a/panda/src/pgraph/qpcamera.cxx b/panda/src/pgraph/camera.cxx similarity index 80% rename from panda/src/pgraph/qpcamera.cxx rename to panda/src/pgraph/camera.cxx index ed0bc05b5d..cb923c69b4 100644 --- a/panda/src/pgraph/qpcamera.cxx +++ b/panda/src/pgraph/camera.cxx @@ -1,4 +1,4 @@ -// Filename: qpcamera.cxx +// Filename: camera.cxx // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -17,33 +17,33 @@ //////////////////////////////////////////////////////////////////// #include "pandabase.h" -#include "qpcamera.h" +#include "camera.h" #include "lens.h" #include "throw_event.h" -TypeHandle qpCamera::_type_handle; +TypeHandle Camera::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCamera::Constructor +// Function: Camera::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpCamera:: -qpCamera(const string &name) : - qpLensNode(name), +Camera:: +Camera(const string &name) : + LensNode(name), _active(true), _camera_mask(DrawMask::all_on()) { } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::Copy Constructor +// Function: Camera::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpCamera:: -qpCamera(const qpCamera ©) : - qpLensNode(copy), +Camera:: +Camera(const Camera ©) : + LensNode(copy), _active(copy._active), _scene(copy._scene), _camera_mask(copy._camera_mask) @@ -51,12 +51,12 @@ qpCamera(const qpCamera ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::Destructor +// Function: Camera::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpCamera:: -~qpCamera() { +Camera:: +~Camera() { // We don't have to destroy the display region(s) associated with // the camera; they're responsible for themselves. However, they // should have removed themselves before we destruct, or something @@ -65,65 +65,65 @@ qpCamera:: } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::make_copy +// Function: Camera::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpCamera:: +PandaNode *Camera:: make_copy() const { - return new qpCamera(*this); + return new Camera(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::safe_to_flatten +// Function: Camera::safe_to_flatten // Access: Public, Virtual // Description: Returns true if it is generally safe to flatten out // this particular kind of Node by duplicating -// instances, false otherwise (for instance, a qpCamera -// cannot be safely flattened, because the qpCamera +// instances, false otherwise (for instance, a Camera +// cannot be safely flattened, because the Camera // pointer itself is meaningful). //////////////////////////////////////////////////////////////////// -bool qpCamera:: +bool Camera:: safe_to_flatten() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::safe_to_transform +// Function: Camera::safe_to_transform // Access: Public, Virtual // Description: Returns true if it is generally safe to transform // this particular kind of Node by calling the xform() // method, false otherwise. For instance, it's usually // a bad idea to attempt to xform a Character. //////////////////////////////////////////////////////////////////// -bool qpCamera:: +bool Camera:: safe_to_transform() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::add_display_region +// Function: Camera::add_display_region // Access: Private // Description: Adds the indicated DisplayRegion to the set of // DisplayRegions shared by the camera. This is only // intended to be called from the DisplayRegion. //////////////////////////////////////////////////////////////////// -void qpCamera:: +void Camera:: add_display_region(DisplayRegion *display_region) { _display_regions.push_back(display_region); } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::remove_display_region +// Function: Camera::remove_display_region // Access: Private // Description: Removes the indicated DisplayRegion from the set of // DisplayRegions shared by the camera. This is only // intended to be called from the DisplayRegion. //////////////////////////////////////////////////////////////////// -void qpCamera:: +void Camera:: remove_display_region(DisplayRegion *display_region) { DisplayRegions::iterator dri = find(_display_regions.begin(), _display_regions.end(), display_region); @@ -133,41 +133,41 @@ remove_display_region(DisplayRegion *display_region) { } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::register_with_read_factory +// Function: Camera::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpCamera. +// Camera. //////////////////////////////////////////////////////////////////// -void qpCamera:: +void Camera:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::write_datagram +// Function: Camera::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpCamera:: +void Camera:: write_datagram(BamWriter *manager, Datagram &dg) { - qpLensNode::write_datagram(manager, dg); + LensNode::write_datagram(manager, dg); dg.add_bool(_active); dg.add_uint32(_camera_mask.get_word()); } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::make_from_bam +// Function: Camera::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpCamera is encountered -// in the Bam file. It should create the qpCamera +// when a new object of type Camera is encountered +// in the Bam file. It should create the Camera // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpCamera:: +TypedWritable *Camera:: make_from_bam(const FactoryParams ¶ms) { - qpCamera *node = new qpCamera(""); + Camera *node = new Camera(""); DatagramIterator scan; BamReader *manager; @@ -178,15 +178,15 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpCamera::fillin +// Function: Camera::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpCamera. +// the new Camera. //////////////////////////////////////////////////////////////////// -void qpCamera:: +void Camera:: fillin(DatagramIterator &scan, BamReader *manager) { - qpLensNode::fillin(scan, manager); + LensNode::fillin(scan, manager); _active = scan.get_bool(); _camera_mask.set_word(scan.get_uint32()); diff --git a/panda/src/pgraph/qpcamera.h b/panda/src/pgraph/camera.h similarity index 81% rename from panda/src/pgraph/qpcamera.h rename to panda/src/pgraph/camera.h index 7bf08f0257..2398184ea8 100644 --- a/panda/src/pgraph/qpcamera.h +++ b/panda/src/pgraph/camera.h @@ -1,4 +1,4 @@ -// Filename: qpcamera.h +// Filename: camera.h // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,31 +16,31 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCAMERA_H -#define qpCAMERA_H +#ifndef CAMERA_H +#define CAMERA_H #include "pandabase.h" -#include "qplensNode.h" -#include "qpnodePath.h" +#include "lensNode.h" +#include "nodePath.h" #include "drawMask.h" class DisplayRegion; //////////////////////////////////////////////////////////////////// -// Class : qpCamera +// Class : Camera // Description : A node that can be positioned around in the scene // graph to represent a point of view for rendering a // scene. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCamera : public qpLensNode { +class EXPCL_PANDA Camera : public LensNode { PUBLISHED: - qpCamera(const string &name); + Camera(const string &name); protected: - qpCamera(const qpCamera ©); + Camera(const Camera ©); public: - virtual ~qpCamera(); + virtual ~Camera(); virtual PandaNode *make_copy() const; virtual bool safe_to_flatten() const; @@ -50,8 +50,8 @@ PUBLISHED: INLINE void set_active(bool active); INLINE bool is_active() const; - INLINE void set_scene(const qpNodePath &scene); - INLINE const qpNodePath &get_scene() const; + INLINE void set_scene(const NodePath &scene); + INLINE const NodePath &get_scene() const; INLINE int get_num_display_regions() const; INLINE DisplayRegion *get_display_region(int n) const; @@ -64,7 +64,7 @@ private: void remove_display_region(DisplayRegion *display_region); bool _active; - qpNodePath _scene; + NodePath _scene; DrawMask _camera_mask; @@ -84,9 +84,9 @@ public: return _type_handle; } static void init_type() { - qpLensNode::init_type(); - register_type(_type_handle, "qpCamera", - qpLensNode::get_class_type()); + LensNode::init_type(); + register_type(_type_handle, "Camera", + LensNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -99,6 +99,6 @@ private: friend class DisplayRegion; }; -#include "qpcamera.I" +#include "camera.I" #endif diff --git a/panda/src/pgraph/colorAttrib.h b/panda/src/pgraph/colorAttrib.h index 682a4b50dd..6e8f30e70d 100644 --- a/panda/src/pgraph/colorAttrib.h +++ b/panda/src/pgraph/colorAttrib.h @@ -24,6 +24,8 @@ #include "renderAttrib.h" #include "luse.h" +class FactoryParams; + //////////////////////////////////////////////////////////////////// // Class : ColorAttrib // Description : Indicates what color should be applied to renderable diff --git a/panda/src/pgraph/colorScaleAttrib.h b/panda/src/pgraph/colorScaleAttrib.h index a4ae167412..e13ec914ee 100644 --- a/panda/src/pgraph/colorScaleAttrib.h +++ b/panda/src/pgraph/colorScaleAttrib.h @@ -24,6 +24,8 @@ #include "renderAttrib.h" #include "luse.h" +class FactoryParams; + //////////////////////////////////////////////////////////////////// // Class : ColorScaleAttrib // Description : Applies a scale to colors in the scene graph and on diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index 0c53a7d03c..1ab6c53765 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -20,7 +20,7 @@ #include "ambientLight.h" #include "billboardEffect.h" -#include "qpcamera.h" +#include "camera.h" #include "colorAttrib.h" #include "colorBlendAttrib.h" #include "colorScaleAttrib.h" @@ -30,27 +30,27 @@ #include "cullBinAttrib.h" #include "cullBinBackToFront.h" #include "cullBinUnsorted.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "cullableObject.h" #include "decalEffect.h" #include "depthOffsetAttrib.h" #include "depthTestAttrib.h" #include "depthWriteAttrib.h" #include "directionalLight.h" -#include "qpfog.h" +#include "fog.h" #include "fogAttrib.h" -#include "qpgeomNode.h" -#include "qplensNode.h" +#include "geomNode.h" +#include "lensNode.h" #include "light.h" #include "lightAttrib.h" #include "lightLensNode.h" #include "lightNode.h" -#include "qplodNode.h" +#include "lodNode.h" #include "materialAttrib.h" -#include "qpmodelNode.h" -#include "qpmodelRoot.h" -#include "qpnodePath.h" -#include "qpnodePathComponent.h" +#include "modelNode.h" +#include "modelRoot.h" +#include "nodePath.h" +#include "nodePathComponent.h" #include "pandaNode.h" #include "pointLight.h" #include "renderAttrib.h" @@ -59,7 +59,7 @@ #include "renderModeAttrib.h" #include "renderState.h" #include "selectiveChildNode.h" -#include "qpsequenceNode.h" +#include "sequenceNode.h" #include "showBoundsEffect.h" #include "spotlight.h" #include "texMatrixAttrib.h" @@ -67,7 +67,7 @@ #include "textureAttrib.h" #include "transformState.h" #include "transparencyAttrib.h" -#include "qpnodePathLerps.h" +#include "nodePathLerps.h" #include "dconfig.h" @@ -81,7 +81,7 @@ ConfigureFn(config_pgraph) { // Set this true to cause culling to be performed by rendering the // object in red wireframe, rather than actually culling it. This // helps make culling errors obvious. -const bool qpfake_view_frustum_cull = config_pgraph.GetBool("fake-view-frustum-cull", false); +const bool fake_view_frustum_cull = config_pgraph.GetBool("fake-view-frustum-cull", false); // Set this true to make ambiguous path warning messages generate an // assertion failure instead of just a warning (which can then be @@ -106,7 +106,7 @@ init_libpgraph() { AmbientLight::init_type(); BillboardEffect::init_type(); - qpCamera::init_type(); + Camera::init_type(); ColorAttrib::init_type(); ColorBlendAttrib::init_type(); ColorScaleAttrib::init_type(); @@ -116,27 +116,27 @@ init_libpgraph() { CullBinAttrib::init_type(); CullBinBackToFront::init_type(); CullBinUnsorted::init_type(); - qpCullTraverser::init_type(); + CullTraverser::init_type(); CullableObject::init_type(); DecalEffect::init_type(); DepthOffsetAttrib::init_type(); DepthTestAttrib::init_type(); DepthWriteAttrib::init_type(); DirectionalLight::init_type(); - qpFog::init_type(); + Fog::init_type(); FogAttrib::init_type(); - qpGeomNode::init_type(); - qpLensNode::init_type(); + GeomNode::init_type(); + LensNode::init_type(); Light::init_type(); LightAttrib::init_type(); LightLensNode::init_type(); LightNode::init_type(); - qpLODNode::init_type(); + LODNode::init_type(); MaterialAttrib::init_type(); - qpModelNode::init_type(); - qpModelRoot::init_type(); - qpNodePath::init_type(); - qpNodePathComponent::init_type(); + ModelNode::init_type(); + ModelRoot::init_type(); + NodePath::init_type(); + NodePathComponent::init_type(); PandaNode::init_type(); PointLight::init_type(); RenderAttrib::init_type(); @@ -145,7 +145,7 @@ init_libpgraph() { RenderModeAttrib::init_type(); RenderState::init_type(); SelectiveChildNode::init_type(); - qpSequenceNode::init_type(); + SequenceNode::init_type(); ShowBoundsEffect::init_type(); Spotlight::init_type(); TexMatrixAttrib::init_type(); @@ -153,18 +153,18 @@ init_libpgraph() { TextureAttrib::init_type(); TransformState::init_type(); TransparencyAttrib::init_type(); - qpPosLerpFunctor::init_type(); - qpHprLerpFunctor::init_type(); - qpScaleLerpFunctor::init_type(); - qpPosHprLerpFunctor::init_type(); - qpHprScaleLerpFunctor::init_type(); - qpPosHprScaleLerpFunctor::init_type(); - qpColorLerpFunctor::init_type(); - qpColorScaleLerpFunctor::init_type(); + PosLerpFunctor::init_type(); + HprLerpFunctor::init_type(); + ScaleLerpFunctor::init_type(); + PosHprLerpFunctor::init_type(); + HprScaleLerpFunctor::init_type(); + PosHprScaleLerpFunctor::init_type(); + ColorLerpFunctor::init_type(); + ColorScaleLerpFunctor::init_type(); AmbientLight::register_with_read_factory(); BillboardEffect::register_with_read_factory(); - qpCamera::register_with_read_factory(); + Camera::register_with_read_factory(); ColorAttrib::register_with_read_factory(); ColorBlendAttrib::register_with_read_factory(); ColorScaleAttrib::register_with_read_factory(); @@ -176,21 +176,21 @@ init_libpgraph() { DepthTestAttrib::register_with_read_factory(); DepthWriteAttrib::register_with_read_factory(); DirectionalLight::register_with_read_factory(); - qpFog::register_with_read_factory(); + Fog::register_with_read_factory(); FogAttrib::register_with_read_factory(); - qpGeomNode::register_with_read_factory(); - qpLensNode::register_with_read_factory(); + GeomNode::register_with_read_factory(); + LensNode::register_with_read_factory(); LightAttrib::register_with_read_factory(); - qpLODNode::register_with_read_factory(); + LODNode::register_with_read_factory(); MaterialAttrib::register_with_read_factory(); - qpModelNode::register_with_read_factory(); - qpModelRoot::register_with_read_factory(); + ModelNode::register_with_read_factory(); + ModelRoot::register_with_read_factory(); PandaNode::register_with_read_factory(); PointLight::register_with_read_factory(); RenderEffects::register_with_read_factory(); RenderModeAttrib::register_with_read_factory(); RenderState::register_with_read_factory(); - qpSequenceNode::register_with_read_factory(); + SequenceNode::register_with_read_factory(); ShowBoundsEffect::register_with_read_factory(); Spotlight::register_with_read_factory(); TexMatrixAttrib::register_with_read_factory(); diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index 255b938ae0..83a6ba5cf3 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -26,7 +26,7 @@ ConfigureDecl(config_pgraph, EXPCL_PANDA, EXPTP_PANDA); NotifyCategoryDecl(pgraph, EXPCL_PANDA, EXPTP_PANDA); -extern const bool qpfake_view_frustum_cull; +extern const bool fake_view_frustum_cull; extern const bool unambiguous_graph; extern EXPCL_PANDA void init_libpgraph(); diff --git a/panda/src/pgraph/cullBinAttrib.h b/panda/src/pgraph/cullBinAttrib.h index 6cb2049f0d..f52c993dc4 100644 --- a/panda/src/pgraph/cullBinAttrib.h +++ b/panda/src/pgraph/cullBinAttrib.h @@ -23,6 +23,8 @@ #include "renderAttrib.h" +class FactoryParams; + //////////////////////////////////////////////////////////////////// // Class : CullBinAttrib // Description : Assigns geometry to a particular bin by name. The diff --git a/panda/src/pgraph/qpcullTraverser.I b/panda/src/pgraph/cullTraverser.I similarity index 85% rename from panda/src/pgraph/qpcullTraverser.I rename to panda/src/pgraph/cullTraverser.I index b71184a56e..99e5ba1b10 100644 --- a/panda/src/pgraph/qpcullTraverser.I +++ b/panda/src/pgraph/cullTraverser.I @@ -1,4 +1,4 @@ -// Filename: qpcullTraverser.I +// Filename: cullTraverser.I // Created by: drose (23Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,42 +18,42 @@ //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_scene +// Function: CullTraverser::set_scene // Access: Public // Description: Sets the SceneSetup object that indicates the initial // camera position, etc. This must be called before // traversal begins. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_scene(SceneSetup *scene_setup) { _scene_setup = scene_setup; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_scene +// Function: CullTraverser::get_scene // Access: Public // Description: Returns the SceneSetup object. //////////////////////////////////////////////////////////////////// -INLINE SceneSetup *qpCullTraverser:: +INLINE SceneSetup *CullTraverser:: get_scene() const { return _scene_setup; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_camera_transform +// Function: CullTraverser::get_camera_transform // Access: Public // Description: Returns the position of the camera relative to the // starting node, without any compensating // coordinate-system transforms that might have been // introduced for the purposes of rendering. //////////////////////////////////////////////////////////////////// -INLINE const TransformState *qpCullTraverser:: +INLINE const TransformState *CullTraverser:: get_camera_transform() const { return _scene_setup->get_camera_transform(); } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_render_transform +// Function: CullTraverser::get_render_transform // Access: Public // Description: Returns the position of the starting node relative // to the camera, pretransformed as appropriate for @@ -65,37 +65,37 @@ get_camera_transform() const { // transform of the current node check in the current // CullTraverserData. //////////////////////////////////////////////////////////////////// -INLINE const TransformState *qpCullTraverser:: +INLINE const TransformState *CullTraverser:: get_render_transform() const { return _scene_setup->get_render_transform(); } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_initial_state +// Function: CullTraverser::set_initial_state // Access: Public // Description: Sets the initial RenderState at the top of the scene // graph we are traversing. If this is not set, the // default is the empty state. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_initial_state(const RenderState *initial_state) { _initial_state = initial_state; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_initial_state +// Function: CullTraverser::get_initial_state // Access: Public // Description: Returns the initial RenderState at the top of the // scene graph we are traversing, or the empty state if // the initial state was never set. //////////////////////////////////////////////////////////////////// -INLINE const RenderState *qpCullTraverser:: +INLINE const RenderState *CullTraverser:: get_initial_state() const { return _initial_state; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_depth_offset_decals +// Function: CullTraverser::set_depth_offset_decals // Access: Public // Description: Sets the depth_offset_decals flag. If this is true, // decals will be rendered using DepthOffsetAttribs; @@ -103,59 +103,59 @@ get_initial_state() const { // expensive three-pass system. This is normally set // from the corresponding flag in the GSG. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_depth_offset_decals(bool flag) { _depth_offset_decals = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_depth_offset_decals +// Function: CullTraverser::get_depth_offset_decals // Access: Public // Description: Returns the depth_offset_decals flag. See // set_depth_offset_decals(). //////////////////////////////////////////////////////////////////// -INLINE bool qpCullTraverser:: +INLINE bool CullTraverser:: get_depth_offset_decals() const { return _depth_offset_decals; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_camera_mask +// Function: CullTraverser::set_camera_mask // Access: Public // Description: Specifies the visibility mask from the camera viewing // the scene. Any nodes that do not have at least some // bits in common with this mask will not be drawn. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_camera_mask(const DrawMask &camera_mask) { _camera_mask = camera_mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_camera_mask +// Function: CullTraverser::get_camera_mask // Access: Public // Description: Returns the visibility mask from the camera viewing // the scene. //////////////////////////////////////////////////////////////////// -INLINE const DrawMask &qpCullTraverser:: +INLINE const DrawMask &CullTraverser:: get_camera_mask() const { return _camera_mask; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_view_frustum +// Function: CullTraverser::set_view_frustum // Access: Public // Description: Specifies the bounding volume that corresponds to the // view frustum. Any primitives that fall entirely // outside of this volume are not drawn. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_view_frustum(GeometricBoundingVolume *view_frustum) { _view_frustum = view_frustum; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_view_frustum +// Function: CullTraverser::get_view_frustum // Access: Public // Description: Returns the bounding volume that corresponds to the // view frustum, or NULL if the view frustum is not in @@ -168,13 +168,13 @@ set_view_frustum(GeometricBoundingVolume *view_frustum) { // node's coordinate space, check in the current // CullTraverserData. //////////////////////////////////////////////////////////////////// -INLINE GeometricBoundingVolume *qpCullTraverser:: +INLINE GeometricBoundingVolume *CullTraverser:: get_view_frustum() const { return _view_frustum; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_guard_band +// Function: CullTraverser::set_guard_band // Access: Public // Description: Specifies the bounding volume to use for detecting // guard band clipping. This is a render optimization @@ -189,13 +189,13 @@ get_view_frustum() const { // 2-d guard band. If a primitive is entirely within // this area, clipping will be disabled on the GSG. //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_guard_band(GeometricBoundingVolume *guard_band) { _guard_band = guard_band; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_guard_band +// Function: CullTraverser::get_guard_band // Access: Public // Description: Returns the bounding volume that corresponds to the // guard band, or NULL if the guard band is not in @@ -208,29 +208,29 @@ set_guard_band(GeometricBoundingVolume *guard_band) { // node's coordinate space, check in the current // CullTraverserData. //////////////////////////////////////////////////////////////////// -INLINE GeometricBoundingVolume *qpCullTraverser:: +INLINE GeometricBoundingVolume *CullTraverser:: get_guard_band() const { return _guard_band; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::set_cull_handler +// Function: CullTraverser::set_cull_handler // Access: Public // Description: Specifies the object that will receive the culled // Geoms. This must be set before calling traverse(). //////////////////////////////////////////////////////////////////// -INLINE void qpCullTraverser:: +INLINE void CullTraverser:: set_cull_handler(CullHandler *cull_handler) { _cull_handler = cull_handler; } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_cull_handler +// Function: CullTraverser::get_cull_handler // Access: Public // Description: Returns the object that will receive the culled // Geoms. //////////////////////////////////////////////////////////////////// -INLINE CullHandler *qpCullTraverser:: +INLINE CullHandler *CullTraverser:: get_cull_handler() const { return _cull_handler; } diff --git a/panda/src/pgraph/qpcullTraverser.cxx b/panda/src/pgraph/cullTraverser.cxx similarity index 90% rename from panda/src/pgraph/qpcullTraverser.cxx rename to panda/src/pgraph/cullTraverser.cxx index 16f752e9cd..66645d692b 100644 --- a/panda/src/pgraph/qpcullTraverser.cxx +++ b/panda/src/pgraph/cullTraverser.cxx @@ -1,4 +1,4 @@ -// Filename: qpcullTraverser.cxx +// Filename: cullTraverser.cxx // Created by: drose (23Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,14 +16,14 @@ // //////////////////////////////////////////////////////////////////// -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "cullTraverserData.h" #include "transformState.h" #include "renderState.h" #include "fogAttrib.h" #include "cullHandler.h" #include "dcast.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "config_pgraph.h" #include "boundingSphere.h" #include "geomSphere.h" @@ -33,15 +33,15 @@ #include "depthOffsetAttrib.h" -TypeHandle qpCullTraverser::_type_handle; +TypeHandle CullTraverser::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::Constructor +// Function: CullTraverser::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCullTraverser:: -qpCullTraverser() { +CullTraverser:: +CullTraverser() { _camera_mask = DrawMask::all_on(); _initial_state = RenderState::make_empty(); _depth_offset_decals = false; @@ -49,12 +49,12 @@ qpCullTraverser() { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::Copy Constructor +// Function: CullTraverser::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpCullTraverser:: -qpCullTraverser(const qpCullTraverser ©) : +CullTraverser:: +CullTraverser(const CullTraverser ©) : _scene_setup(copy._scene_setup), _camera_mask(copy._camera_mask), _initial_state(copy._initial_state), @@ -66,12 +66,12 @@ qpCullTraverser(const qpCullTraverser ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::traverse +// Function: CullTraverser::traverse // Access: Public // Description: Begins the traversal from the indicated node. //////////////////////////////////////////////////////////////////// -void qpCullTraverser:: -traverse(const qpNodePath &root) { +void CullTraverser:: +traverse(const NodePath &root) { nassertv(_cull_handler != (CullHandler *)NULL); nassertv(_scene_setup != (SceneSetup *)NULL); @@ -82,13 +82,13 @@ traverse(const qpNodePath &root) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::traverse +// Function: CullTraverser::traverse // Access: Public // Description: Traverses from the next node with the given // data, which has been constructed with the node but // has not yet been converted into the node's space. //////////////////////////////////////////////////////////////////// -void qpCullTraverser:: +void CullTraverser:: traverse(CullTraverserData &data) { // Most nodes will have no transform or state, and will not // contain decals or require a special cull callback. As an @@ -108,7 +108,7 @@ traverse(CullTraverserData &data) { const RenderState *node_state = node->get_state(); const FogAttrib *fog = node_state->get_fog(); - if (fog != (const FogAttrib *)NULL && fog->get_fog() != (qpFog *)NULL) { + if (fog != (const FogAttrib *)NULL && fog->get_fog() != (Fog *)NULL) { // If we just introduced a FogAttrib here, call adjust_to_camera() // now. This maybe isn't the perfect time to call it, but it's // good enough; and at this time we have all the information we @@ -127,13 +127,13 @@ traverse(CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::traverse_below +// Function: CullTraverser::traverse_below // Access: Public // Description: Traverses all the children of the indicated node, // with the given data, which been converted into the // node's space. //////////////////////////////////////////////////////////////////// -void qpCullTraverser:: +void CullTraverser:: traverse_below(CullTraverserData &data) { PandaNode *node = data.node(); const RenderEffects *node_effects = node->get_effects(); @@ -145,7 +145,7 @@ traverse_below(CullTraverserData &data) { } else { if (node->is_geom_node()) { - qpGeomNode *geom_node = DCAST(qpGeomNode, node); + GeomNode *geom_node = DCAST(GeomNode, node); // Get all the Geoms, with no decalling. int num_geoms = geom_node->get_num_geoms(); @@ -192,12 +192,12 @@ traverse_below(CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::show_bounds +// Function: CullTraverser::show_bounds // Access: Private // Description: Draws an appropriate visualization of the node's // external bounding volume. //////////////////////////////////////////////////////////////////// -void qpCullTraverser:: +void CullTraverser:: show_bounds(CullTraverserData &data) { PandaNode *node = data.node(); @@ -216,12 +216,12 @@ show_bounds(CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::make_bounds_viz +// Function: CullTraverser::make_bounds_viz // Access: Private // Description: Returns an appropriate visualization of the indicated // bounding volume. //////////////////////////////////////////////////////////////////// -PT(Geom) qpCullTraverser:: +PT(Geom) CullTraverser:: make_bounds_viz(const BoundingVolume &vol) { PT(Geom) geom; if (vol.is_infinite()) { @@ -249,12 +249,12 @@ make_bounds_viz(const BoundingVolume &vol) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_bounds_outer_viz_state +// Function: CullTraverser::get_bounds_outer_viz_state // Access: Private, Static // Description: Returns a RenderState for rendering the outside // surfaces of the bounding volume visualizations. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpCullTraverser:: +CPT(RenderState) CullTraverser:: get_bounds_outer_viz_state() { // Once someone asks for this pointer, we hold its reference count // and never free it. @@ -269,12 +269,12 @@ get_bounds_outer_viz_state() { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_bounds_inner_viz_state +// Function: CullTraverser::get_bounds_inner_viz_state // Access: Private, Static // Description: Returns a RenderState for rendering the inside // surfaces of the bounding volume visualizations. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpCullTraverser:: +CPT(RenderState) CullTraverser:: get_bounds_inner_viz_state() { // Once someone asks for this pointer, we hold its reference count // and never free it. @@ -289,12 +289,12 @@ get_bounds_inner_viz_state() { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::get_depth_offset_state +// Function: CullTraverser::get_depth_offset_state // Access: Private, Static // Description: Returns a RenderState for increasing the DepthOffset // by one. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpCullTraverser:: +CPT(RenderState) CullTraverser:: get_depth_offset_state() { // Once someone asks for this pointer, we hold its reference count // and never free it. @@ -308,13 +308,13 @@ get_depth_offset_state() { //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::start_decal +// Function: CullTraverser::start_decal // Access: Private // Description: Collects a base node and all of the decals applied to // it. This involves recursing below the base GeomNode // to find all the decal geoms. //////////////////////////////////////////////////////////////////// -void qpCullTraverser:: +void CullTraverser:: start_decal(const CullTraverserData &data) { PandaNode *node = data.node(); if (!node->is_geom_node()) { @@ -354,7 +354,7 @@ start_decal(const CullTraverserData &data) { // And now get the base Geoms, again in reverse order. CullableObject *object = separator; - qpGeomNode *geom_node = DCAST(qpGeomNode, node); + GeomNode *geom_node = DCAST(GeomNode, node); int num_geoms = geom_node->get_num_geoms(); for (int i = num_geoms - 1; i >= 0; i--) { object = new CullableObject(data, geom_node, i, object); @@ -369,7 +369,7 @@ start_decal(const CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpCullTraverser::r_get_decals +// Function: CullTraverser::r_get_decals // Access: Private // Description: Recursively gets all the decals applied to a // particular GeomNode. These are built into a @@ -377,7 +377,7 @@ start_decal(const CullTraverserData &data) { // traversing the list will extract them in the order // they were encountered in the scene graph). //////////////////////////////////////////////////////////////////// -CullableObject *qpCullTraverser:: +CullableObject *CullTraverser:: r_get_decals(CullTraverserData &data, CullableObject *decals) { if (data.is_in_view(_camera_mask)) { PandaNode *node = data.node(); @@ -410,7 +410,7 @@ r_get_decals(CullTraverserData &data, CullableObject *decals) { // Now, tack on any geoms within the node. if (node->is_geom_node()) { - qpGeomNode *geom_node = DCAST(qpGeomNode, node); + GeomNode *geom_node = DCAST(GeomNode, node); int num_geoms = geom_node->get_num_geoms(); for (int i = num_geoms - 1; i >= 0; i--) { diff --git a/panda/src/pgraph/qpcullTraverser.h b/panda/src/pgraph/cullTraverser.h similarity index 90% rename from panda/src/pgraph/qpcullTraverser.h rename to panda/src/pgraph/cullTraverser.h index ed5ee4e957..8f0f8bac31 100644 --- a/panda/src/pgraph/qpcullTraverser.h +++ b/panda/src/pgraph/cullTraverser.h @@ -1,4 +1,4 @@ -// Filename: qpcullTraverser.h +// Filename: cullTraverser.h // Created by: drose (23Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpCULLTRAVERSER_H -#define qpCULLTRAVERSER_H +#ifndef CULLTRAVERSER_H +#define CULLTRAVERSER_H #include "pandabase.h" @@ -34,7 +34,7 @@ class PandaNode; class CullHandler; class CullTraverserData; class CullableObject; -class qpNodePath; +class NodePath; //////////////////////////////////////////////////////////////////// // Class : CullTraverser @@ -44,10 +44,10 @@ class qpNodePath; // Each renderable Geom encountered is passed along with // its associated RenderState to the CullHandler object. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpCullTraverser : public TypedObject { +class EXPCL_PANDA CullTraverser : public TypedObject { public: - qpCullTraverser(); - qpCullTraverser(const qpCullTraverser ©); + CullTraverser(); + CullTraverser(const CullTraverser ©); INLINE void set_scene(SceneSetup *scene_setup); INLINE SceneSetup *get_scene() const; @@ -73,7 +73,7 @@ public: INLINE void set_cull_handler(CullHandler *cull_handler); INLINE CullHandler *get_cull_handler() const; - void traverse(const qpNodePath &root); + void traverse(const NodePath &root); void traverse(CullTraverserData &data); void traverse_below(CullTraverserData &data); @@ -101,7 +101,7 @@ public: } static void init_type() { TypedObject::init_type(); - register_type(_type_handle, "qpCullTraverser", + register_type(_type_handle, "CullTraverser", TypedObject::get_class_type()); } virtual TypeHandle get_type() const { @@ -113,7 +113,7 @@ private: static TypeHandle _type_handle; }; -#include "qpcullTraverser.I" +#include "cullTraverser.I" #endif diff --git a/panda/src/pgraph/cullTraverserData.I b/panda/src/pgraph/cullTraverserData.I index bd62b6d45b..8f14ce31f6 100644 --- a/panda/src/pgraph/cullTraverserData.I +++ b/panda/src/pgraph/cullTraverserData.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE CullTraverserData:: -CullTraverserData(const qpNodePath &start, +CullTraverserData(const NodePath &start, const TransformState *render_transform, const TransformState *net_transform, const RenderState *state, @@ -62,7 +62,7 @@ CullTraverserData(const CullTraverserData &parent, PandaNode *child) : //////////////////////////////////////////////////////////////////// INLINE CullTraverserData:: CullTraverserData(const CullTraverserData ©) : - _node_path(qpNodePath()) + _node_path(NodePath()) { nassertv(false); } diff --git a/panda/src/pgraph/cullTraverserData.cxx b/panda/src/pgraph/cullTraverserData.cxx index 925f067e56..b2863bcc2d 100644 --- a/panda/src/pgraph/cullTraverserData.cxx +++ b/panda/src/pgraph/cullTraverserData.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "cullTraverserData.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "config_pgraph.h" #include "pandaNode.h" #include "colorAttrib.h" @@ -33,7 +33,7 @@ // billboards, etc. //////////////////////////////////////////////////////////////////// void CullTraverserData:: -apply_transform_and_state(qpCullTraverser *trav) { +apply_transform_and_state(CullTraverser *trav) { const TransformState *node_transform = node()->get_transform(); if (!node_transform->is_identity()) { _render_transform = _render_transform->compose(node_transform); @@ -107,7 +107,7 @@ is_in_view_impl() { int result = _view_frustum->contains(node_gbv); if (result == BoundingVolume::IF_no_intersection) { // No intersection at all. Cull. - if (!qpfake_view_frustum_cull) { + if (!fake_view_frustum_cull) { return false; } diff --git a/panda/src/pgraph/cullTraverserData.h b/panda/src/pgraph/cullTraverserData.h index 1d7d474d1a..be4d907768 100644 --- a/panda/src/pgraph/cullTraverserData.h +++ b/panda/src/pgraph/cullTraverserData.h @@ -29,7 +29,7 @@ #include "drawMask.h" class PandaNode; -class qpCullTraverser; +class CullTraverser; //////////////////////////////////////////////////////////////////// // Class : CullTraverserData @@ -47,7 +47,7 @@ class qpCullTraverser; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CullTraverserData { public: - INLINE CullTraverserData(const qpNodePath &start, + INLINE CullTraverserData(const NodePath &start, const TransformState *render_transform, const TransformState *net_transform, const RenderState *state, @@ -66,7 +66,7 @@ public: INLINE PandaNode *node() const; INLINE bool is_in_view(const DrawMask &camera_mask); - void apply_transform_and_state(qpCullTraverser *trav); + void apply_transform_and_state(CullTraverser *trav); WorkingNodePath _node_path; CPT(TransformState) _render_transform; diff --git a/panda/src/pgraph/cullableObject.I b/panda/src/pgraph/cullableObject.I index d8c2cb7063..bfd9100c8c 100644 --- a/panda/src/pgraph/cullableObject.I +++ b/panda/src/pgraph/cullableObject.I @@ -37,7 +37,7 @@ CullableObject(CullableObject *next) : //////////////////////////////////////////////////////////////////// INLINE CullableObject:: CullableObject(const CullTraverserData &data, - qpGeomNode *geom_node, int i, + GeomNode *geom_node, int i, CullableObject *next) : _geom(geom_node->get_geom(i)), _state(data._state->compose(geom_node->get_geom_state(i))), diff --git a/panda/src/pgraph/cullableObject.h b/panda/src/pgraph/cullableObject.h index 96024b0f50..6f8a4b3987 100644 --- a/panda/src/pgraph/cullableObject.h +++ b/panda/src/pgraph/cullableObject.h @@ -26,7 +26,7 @@ #include "transformState.h" #include "pointerTo.h" #include "referenceCount.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "cullTraverserData.h" //////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ class EXPCL_PANDA CullableObject { public: INLINE CullableObject(CullableObject *next = NULL); INLINE CullableObject(const CullTraverserData &data, - qpGeomNode *geom_node, int i, + GeomNode *geom_node, int i, CullableObject *next = NULL); INLINE CullableObject(Geom *geom, const RenderState *state, const TransformState *transform, diff --git a/panda/src/pgraph/qpfindApproxLevel.I b/panda/src/pgraph/findApproxLevel.I similarity index 84% rename from panda/src/pgraph/qpfindApproxLevel.I rename to panda/src/pgraph/findApproxLevel.I index f2b74a4189..a612a058eb 100644 --- a/panda/src/pgraph/qpfindApproxLevel.I +++ b/panda/src/pgraph/findApproxLevel.I @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevel.I +// Filename: findApproxLevel.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,12 +18,12 @@ //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevel::add_entry +// Function: FindApproxLevel::add_entry // Access: Public // Description: Adds a new entry to the level. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxLevel:: -add_entry(const qpFindApproxLevelEntry &entry) { +INLINE void FindApproxLevel:: +add_entry(const FindApproxLevelEntry &entry) { _v.push_back(entry); } diff --git a/panda/src/pgraph/qpfindApproxLevel.cxx b/panda/src/pgraph/findApproxLevel.cxx similarity index 88% rename from panda/src/pgraph/qpfindApproxLevel.cxx rename to panda/src/pgraph/findApproxLevel.cxx index b114f7c94b..01f9a70534 100644 --- a/panda/src/pgraph/qpfindApproxLevel.cxx +++ b/panda/src/pgraph/findApproxLevel.cxx @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevel.cxx +// Filename: findApproxLevel.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,15 +16,15 @@ // //////////////////////////////////////////////////////////////////// -#include "qpfindApproxLevel.h" +#include "findApproxLevel.h" //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevel::write +// Function: FindApproxLevel::write // Access: Public // Description: Shows the entire contents of the level, one entry per // line. For debugging only. //////////////////////////////////////////////////////////////////// -void qpFindApproxLevel:: +void FindApproxLevel:: write(ostream &out) const { Vec::const_iterator vi; for (vi = _v.begin(); vi != _v.end(); ++vi) { diff --git a/panda/src/pgraph/qpfindApproxLevel.h b/panda/src/pgraph/findApproxLevel.h similarity index 77% rename from panda/src/pgraph/qpfindApproxLevel.h rename to panda/src/pgraph/findApproxLevel.h index a19b1892b7..f0f9812039 100644 --- a/panda/src/pgraph/qpfindApproxLevel.h +++ b/panda/src/pgraph/findApproxLevel.h @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevel.h +// Filename: findApproxLevel.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,31 +16,31 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpFINDAPPROXLEVEL_H -#define qpFINDAPPROXLEVEL_H +#ifndef FINDAPPROXLEVEL_H +#define FINDAPPROXLEVEL_H #include "pandabase.h" -#include "qpfindApproxLevelEntry.h" +#include "findApproxLevelEntry.h" #include "pvector.h" //////////////////////////////////////////////////////////////////// -// Class : qpFindApproxLevel +// Class : FindApproxLevel // Description : This class is local to this package only; it doesn't // get exported. It maintains the list of nodes // find_approx() considers for each level of the scene // graph it visits, in its breadth-first search. //////////////////////////////////////////////////////////////////// -class qpFindApproxLevel { +class FindApproxLevel { public: - INLINE void add_entry(const qpFindApproxLevelEntry &entry); + INLINE void add_entry(const FindApproxLevelEntry &entry); void write(ostream &out) const; - typedef pvector Vec; + typedef pvector Vec; Vec _v; }; -#include "qpfindApproxLevel.I" +#include "findApproxLevel.I" #endif diff --git a/panda/src/pgraph/qpfindApproxLevelEntry.I b/panda/src/pgraph/findApproxLevelEntry.I similarity index 75% rename from panda/src/pgraph/qpfindApproxLevelEntry.I rename to panda/src/pgraph/findApproxLevelEntry.I index ab8da5e4e0..aff0365bfe 100644 --- a/panda/src/pgraph/qpfindApproxLevelEntry.I +++ b/panda/src/pgraph/findApproxLevelEntry.I @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevelEntry.I +// Filename: findApproxLevelEntry.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,12 +18,12 @@ //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::Constructor +// Function: FindApproxLevelEntry::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpFindApproxLevelEntry:: -qpFindApproxLevelEntry(const qpNodePath &node_path, qpFindApproxPath &approx_path) : +INLINE FindApproxLevelEntry:: +FindApproxLevelEntry(const NodePath &node_path, FindApproxPath &approx_path) : _node_path(node_path), _approx_path(approx_path) { @@ -31,12 +31,12 @@ qpFindApproxLevelEntry(const qpNodePath &node_path, qpFindApproxPath &approx_pat } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::Copy Constructor +// Function: FindApproxLevelEntry::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpFindApproxLevelEntry:: -qpFindApproxLevelEntry(const qpFindApproxLevelEntry ©) : +INLINE FindApproxLevelEntry:: +FindApproxLevelEntry(const FindApproxLevelEntry ©) : _node_path(copy._node_path), _i(copy._i), _approx_path(copy._approx_path) @@ -44,12 +44,12 @@ qpFindApproxLevelEntry(const qpFindApproxLevelEntry ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::Copy Assignment Operator +// Function: FindApproxLevelEntry::Copy Assignment Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxLevelEntry:: -operator = (const qpFindApproxLevelEntry ©) { +INLINE void FindApproxLevelEntry:: +operator = (const FindApproxLevelEntry ©) { _node_path = copy._node_path; _i = copy._i; nassertv(&_approx_path == ©._approx_path); @@ -57,24 +57,24 @@ operator = (const qpFindApproxLevelEntry ©) { //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::next_is_stashed +// Function: FindApproxLevelEntry::next_is_stashed // Access: Public // Description: Returns true if the next node matched by this entry // must be a stashed node, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxLevelEntry:: +INLINE bool FindApproxLevelEntry:: next_is_stashed() const { return _approx_path.matches_stashed(_i); } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::is_solution +// Function: FindApproxLevelEntry::is_solution // Access: Public // Description: Returns true if this entry represents a solution to // the search; i.e. all the components of the path have // been successfully matched. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxLevelEntry:: +INLINE bool FindApproxLevelEntry:: is_solution() const { return (_i >= _approx_path.get_num_components()); } diff --git a/panda/src/pgraph/qpfindApproxLevelEntry.cxx b/panda/src/pgraph/findApproxLevelEntry.cxx similarity index 84% rename from panda/src/pgraph/qpfindApproxLevelEntry.cxx rename to panda/src/pgraph/findApproxLevelEntry.cxx index 3916b5254f..6ad8a75f91 100644 --- a/panda/src/pgraph/qpfindApproxLevelEntry.cxx +++ b/panda/src/pgraph/findApproxLevelEntry.cxx @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevelEntry.cxx +// Filename: findApproxLevelEntry.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,18 +16,18 @@ // //////////////////////////////////////////////////////////////////// -#include "qpfindApproxLevelEntry.h" -#include "qpnodePathCollection.h" +#include "findApproxLevelEntry.h" +#include "nodePathCollection.h" #include "pandaNode.h" //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::output +// Function: FindApproxLevelEntry::output // Access: Public // Description: Formats the entry for meaningful output. For // debugging only. //////////////////////////////////////////////////////////////////// -void qpFindApproxLevelEntry:: +void FindApproxLevelEntry:: output(ostream &out) const { out << "(" << _node_path << "):"; if (is_solution()) { @@ -40,12 +40,12 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::consider_node +// Function: FindApproxLevelEntry::consider_node // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpFindApproxLevelEntry:: -consider_node(qpNodePathCollection &result, qpFindApproxLevel &next_level, +void FindApproxLevelEntry:: +consider_node(NodePathCollection &result, FindApproxLevel &next_level, int max_matches) const { nassertv(_i < _approx_path.get_num_components()); @@ -56,7 +56,7 @@ consider_node(qpNodePathCollection &result, qpFindApproxLevel &next_level, // This means we must reconsider our own entry with the next path // entry, before we consider the next entry--this supports // matching zero levels of nodes. - qpFindApproxLevelEntry reconsider(*this); + FindApproxLevelEntry reconsider(*this); ++reconsider._i; if (reconsider.is_solution()) { @@ -103,7 +103,7 @@ consider_node(qpNodePathCollection &result, qpFindApproxLevel &next_level, } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxLevelEntry::consider_next_step +// Function: FindApproxLevelEntry::consider_next_step // Access: Public // Description: Compares the indicated child node (which is assumed // to be a child of _node_path) with the next component @@ -113,9 +113,9 @@ consider_node(qpNodePathCollection &result, qpFindApproxLevel &next_level, // // If a complete solution is found, stores it in result. //////////////////////////////////////////////////////////////////// -void qpFindApproxLevelEntry:: -consider_next_step(qpNodePathCollection &result, PandaNode *child_node, - qpFindApproxLevel &next_level, int max_matches) const { +void FindApproxLevelEntry:: +consider_next_step(NodePathCollection &result, PandaNode *child_node, + FindApproxLevel &next_level, int max_matches) const { if (!_approx_path.return_hidden() && child_node->get_draw_mask().is_zero()) { // If the approx path does not allow us to return hidden nodes, @@ -133,16 +133,16 @@ consider_next_step(qpNodePathCollection &result, PandaNode *child_node, // And now we just add the next entry without incrementing its // path entry. - qpFindApproxLevelEntry next(*this); - next._node_path = qpNodePath(_node_path, child_node); + FindApproxLevelEntry next(*this); + next._node_path = NodePath(_node_path, child_node); next_level.add_entry(next); } else { if (_approx_path.matches_component(_i, child_node)) { // That matched, and it consumes one path entry. - qpFindApproxLevelEntry next(*this); + FindApproxLevelEntry next(*this); ++next._i; - next._node_path = qpNodePath(_node_path, child_node); + next._node_path = NodePath(_node_path, child_node); next_level.add_entry(next); } } diff --git a/panda/src/pgraph/qpfindApproxLevelEntry.h b/panda/src/pgraph/findApproxLevelEntry.h similarity index 64% rename from panda/src/pgraph/qpfindApproxLevelEntry.h rename to panda/src/pgraph/findApproxLevelEntry.h index 50a14cacc8..4b2ba58f9b 100644 --- a/panda/src/pgraph/qpfindApproxLevelEntry.h +++ b/panda/src/pgraph/findApproxLevelEntry.h @@ -1,4 +1,4 @@ -// Filename: qpfindApproxLevelEntry.h +// Filename: findApproxLevelEntry.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,37 +16,37 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpFINDAPPROXLEVELENTRY_H -#define qpFINDAPPROXLEVELENTRY_H +#ifndef FINDAPPROXLEVELENTRY_H +#define FINDAPPROXLEVELENTRY_H #include "pandabase.h" -#include "qpfindApproxPath.h" -#include "qpnodePath.h" +#include "findApproxPath.h" +#include "nodePath.h" -class qpFindApproxLevel; -class qpNodePathCollection; +class FindApproxLevel; +class NodePathCollection; //////////////////////////////////////////////////////////////////// -// Class : qpFindApproxLevelEntry +// Class : FindApproxLevelEntry // Description : This class is local to this package only; it doesn't // get exported. It represents a single node under // consideration for matching at a single point in the // breadth-first search. //////////////////////////////////////////////////////////////////// -class qpFindApproxLevelEntry { +class FindApproxLevelEntry { public: - INLINE qpFindApproxLevelEntry(const qpNodePath &node_path, - qpFindApproxPath &approx_path); - INLINE qpFindApproxLevelEntry(const qpFindApproxLevelEntry ©); - INLINE void operator = (const qpFindApproxLevelEntry ©); + INLINE FindApproxLevelEntry(const NodePath &node_path, + FindApproxPath &approx_path); + INLINE FindApproxLevelEntry(const FindApproxLevelEntry ©); + INLINE void operator = (const FindApproxLevelEntry ©); INLINE bool next_is_stashed() const; - void consider_node(qpNodePathCollection &result, qpFindApproxLevel &next_level, + void consider_node(NodePathCollection &result, FindApproxLevel &next_level, int max_matches) const; - void consider_next_step(qpNodePathCollection &result, - PandaNode *child_node, qpFindApproxLevel &next_level, + void consider_next_step(NodePathCollection &result, + PandaNode *child_node, FindApproxLevel &next_level, int max_matches) const; INLINE bool is_solution() const; @@ -54,22 +54,22 @@ public: // _node_path represents the most recent node that we have // previously accepted as being a partial solution. - qpNodePath _node_path; + NodePath _node_path; // _i represents the next component in the approx_path that must be // matched against all of the children of _node_path, above. If _i // refers to the end of the approx_path, then _node_path is a // solution. int _i; - qpFindApproxPath &_approx_path; + FindApproxPath &_approx_path; }; INLINE ostream & -operator << (ostream &out, const qpFindApproxLevelEntry &entry) { +operator << (ostream &out, const FindApproxLevelEntry &entry) { entry.output(out); return out; } -#include "qpfindApproxLevelEntry.I" +#include "findApproxLevelEntry.I" #endif diff --git a/panda/src/pgraph/qpfindApproxPath.I b/panda/src/pgraph/findApproxPath.I similarity index 83% rename from panda/src/pgraph/qpfindApproxPath.I rename to panda/src/pgraph/findApproxPath.I index 3dc08169a3..41e19e2dcc 100644 --- a/panda/src/pgraph/qpfindApproxPath.I +++ b/panda/src/pgraph/findApproxPath.I @@ -1,4 +1,4 @@ -// Filename: qpfindApproxPath.I +// Filename: findApproxPath.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,23 +18,23 @@ //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::Constructor +// Function: FindApproxPath::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpFindApproxPath:: -qpFindApproxPath() { +INLINE FindApproxPath:: +FindApproxPath() { _return_hidden = true; _return_stashed = false; } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_name +// Function: FindApproxPath::add_match_name // Access: Public // Description: Adds a component that must match the name of a node // exactly. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_name(const string &name, int flags) { Component comp; comp._type = CT_match_name; @@ -44,13 +44,13 @@ add_match_name(const string &name, int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_name_glob +// Function: FindApproxPath::add_match_name_glob // Access: Public // Description: Adds a component that must match the name of a node // using standard shell globbing rules, with wildcard // characters accepted. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_name_glob(const string &name, int flags) { Component comp; comp._type = CT_match_name_glob; @@ -60,12 +60,12 @@ add_match_name_glob(const string &name, int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_exact_type +// Function: FindApproxPath::add_match_exact_type // Access: Public // Description: Adds a component that must match the type of a node // exactly, with no derived types matching. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_exact_type(TypeHandle type, int flags) { Component comp; comp._type = CT_match_exact_type; @@ -75,12 +75,12 @@ add_match_exact_type(TypeHandle type, int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_inexact_type +// Function: FindApproxPath::add_match_inexact_type // Access: Public // Description: Adds a component that must match the type of a node // or be a base class of the node's type. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_inexact_type(TypeHandle type, int flags) { Component comp; comp._type = CT_match_inexact_type; @@ -90,12 +90,12 @@ add_match_inexact_type(TypeHandle type, int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_one +// Function: FindApproxPath::add_match_one // Access: Public // Description: Adds a component that will match any node (but not a // chain of many nodes). //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_one(int flags) { Component comp; comp._type = CT_match_one; @@ -104,12 +104,12 @@ add_match_one(int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_many +// Function: FindApproxPath::add_match_many // Access: Public // Description: Adds a component that will match a chain of zero or // more consecutive nodes. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_many(int flags) { Component comp; comp._type = CT_match_many; @@ -118,12 +118,12 @@ add_match_many(int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_match_pointer +// Function: FindApproxPath::add_match_pointer // Access: Public // Description: Adds a component that must match a particular node // exactly, by pointer. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: add_match_pointer(PandaNode *pointer, int flags) { Component comp; comp._type = CT_match_pointer; @@ -133,46 +133,46 @@ add_match_pointer(PandaNode *pointer, int flags) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::get_num_components +// Function: FindApproxPath::get_num_components // Access: Public // Description: Returns the number of components in the path. //////////////////////////////////////////////////////////////////// -INLINE int qpFindApproxPath:: +INLINE int FindApproxPath:: get_num_components() const { return _path.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::is_component_match_many +// Function: FindApproxPath::is_component_match_many // Access: Public // Description: Returns true if the nth component is of type // match_many, which will require special handling. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxPath:: +INLINE bool FindApproxPath:: is_component_match_many(int index) const { nassertr(index >= 0 && index < (int)_path.size(), false); return (_path[index]._type == CT_match_many); } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::matches_component +// Function: FindApproxPath::matches_component // Access: Public // Description: Returns true if the nth component of the path matches // the indicated node, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxPath:: +INLINE bool FindApproxPath:: matches_component(int index, PandaNode *node) const { nassertr(index >= 0 && index < (int)_path.size(), false); return (_path[index].matches(node)); } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::matches_stashed +// Function: FindApproxPath::matches_stashed // Access: Public // Description: Returns true if the nth component of the path matches // a stashed node only, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxPath:: +INLINE bool FindApproxPath:: matches_stashed(int index) const { if (index >= 0 && index < (int)_path.size()) { return ((_path[index]._flags & CF_stashed) != 0); @@ -182,34 +182,34 @@ matches_stashed(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::return_hidden +// Function: FindApproxPath::return_hidden // Access: Public // Description: Returns true if this path allows returning of hidden // nodes, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxPath:: +INLINE bool FindApproxPath:: return_hidden() const { return _return_hidden; } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::return_stashed +// Function: FindApproxPath::return_stashed // Access: Public // Description: Returns true if this path allows returning of stashed // nodes, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpFindApproxPath:: +INLINE bool FindApproxPath:: return_stashed() const { return _return_stashed; } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::output_component +// Function: FindApproxPath::output_component // Access: Public // Description: Formats the nth component of the path to the // indicated output stream. //////////////////////////////////////////////////////////////////// -INLINE void qpFindApproxPath:: +INLINE void FindApproxPath:: output_component(ostream &out, int index) const { nassertv(index >= 0 && index < (int)_path.size()); out << _path[index]; diff --git a/panda/src/pgraph/qpfindApproxPath.cxx b/panda/src/pgraph/findApproxPath.cxx similarity index 87% rename from panda/src/pgraph/qpfindApproxPath.cxx rename to panda/src/pgraph/findApproxPath.cxx index 6be73b5375..38647b4ff5 100644 --- a/panda/src/pgraph/qpfindApproxPath.cxx +++ b/panda/src/pgraph/findApproxPath.cxx @@ -1,4 +1,4 @@ -// Filename: qpfindApproxPath.cxx +// Filename: findApproxPath.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qpfindApproxPath.h" +#include "findApproxPath.h" #include "config_pgraph.h" #include "globPattern.h" @@ -24,12 +24,12 @@ //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::Component::matches +// Function: FindApproxPath::Component::matches // Access: Public // Description: Returns true if the indicated node matches this // component, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpFindApproxPath::Component:: +bool FindApproxPath::Component:: matches(PandaNode *node) const { string node_name; @@ -65,16 +65,16 @@ matches(PandaNode *node) const { } pgraph_cat.error() - << "Invalid component in qpFindApproxPath\n"; + << "Invalid component in FindApproxPath\n"; return false; } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::Component::output +// Function: FindApproxPath::Component::output // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpFindApproxPath::Component:: +void FindApproxPath::Component:: output(ostream &out) const { out << _type; if (_type == CT_match_name || _type == CT_match_name_glob) { @@ -89,14 +89,14 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_string +// Function: FindApproxPath::add_string // Access: Public // Description: Adds a sequence of components separated by slashes, // followed optionally by a semicolon and a sequence of // control flags, to the path sequence. Returns true if // successful, false if the string contained an error. //////////////////////////////////////////////////////////////////// -bool qpFindApproxPath:: +bool FindApproxPath:: add_string(const string &str_path) { size_t start = 0; size_t slash = str_path.find('/'); @@ -130,14 +130,14 @@ add_string(const string &str_path) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_flags +// Function: FindApproxPath::add_flags // Access: Public // Description: Adds a sequence of control flags. This will be a // sequence of letters preceded by either '+' or '-', // with no intervening punctuation. Returns true if // successful, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpFindApproxPath:: +bool FindApproxPath:: add_flags(const string &str_flags) { string::const_iterator pi = str_flags.begin(); while (pi != str_flags.end()) { @@ -185,14 +185,14 @@ add_flags(const string &str_flags) { //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::add_component +// Function: FindApproxPath::add_component // Access: Public // Description: Adds a single component to the path sequence, defined // by a string as might appear between slashes in the // path string. Returns true if successful, false if // the string component was in some way invalid. //////////////////////////////////////////////////////////////////// -bool qpFindApproxPath:: +bool FindApproxPath:: add_component(string str_component) { int flags = 0; if (str_component.size() >= 2 && str_component.substr(0, 2) == "@@") { @@ -214,9 +214,9 @@ add_component(string str_component) { } else if (!str_component.empty() && str_component[0] == '-') { string type_name = str_component.substr(1); - // *** for now, as a quick hack, if a type exists with the "qp" + // *** for now, as a quick hack, if a type exists with the "" // prefix on the named type, we search for that type instead. - TypeHandle handle = TypeRegistry::ptr()->find_type("qp" + type_name); + TypeHandle handle = TypeRegistry::ptr()->find_type("" + type_name); if (handle == TypeHandle::none()) { handle = TypeRegistry::ptr()->find_type(type_name); } @@ -233,9 +233,9 @@ add_component(string str_component) { } else if (!str_component.empty() && str_component[0] == '+') { string type_name = str_component.substr(1); - // *** for now, as a quick hack, if a type exists with the "qp" + // *** for now, as a quick hack, if a type exists with the "" // prefix on the named type, we search for that type instead. - TypeHandle handle = TypeRegistry::ptr()->find_type("qp" + type_name); + TypeHandle handle = TypeRegistry::ptr()->find_type("" + type_name); if (handle == TypeHandle::none()) { handle = TypeRegistry::ptr()->find_type(type_name); } @@ -257,11 +257,11 @@ add_component(string str_component) { } //////////////////////////////////////////////////////////////////// -// Function: qpFindApproxPath::output +// Function: FindApproxPath::output // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpFindApproxPath:: +void FindApproxPath:: output(ostream &out) const { out << "("; if (!_path.empty()) { @@ -277,27 +277,27 @@ output(ostream &out) const { } ostream & -operator << (ostream &out, qpFindApproxPath::ComponentType type) { +operator << (ostream &out, FindApproxPath::ComponentType type) { switch (type) { - case qpFindApproxPath::CT_match_name: + case FindApproxPath::CT_match_name: return out << "match_name"; - case qpFindApproxPath::CT_match_name_glob: + case FindApproxPath::CT_match_name_glob: return out << "match_name_glob"; - case qpFindApproxPath::CT_match_exact_type: + case FindApproxPath::CT_match_exact_type: return out << "match_exact_type"; - case qpFindApproxPath::CT_match_inexact_type: + case FindApproxPath::CT_match_inexact_type: return out << "match_inexact_type"; - case qpFindApproxPath::CT_match_one: + case FindApproxPath::CT_match_one: return out << "match_one"; - case qpFindApproxPath::CT_match_many: + case FindApproxPath::CT_match_many: return out << "match_many"; - case qpFindApproxPath::CT_match_pointer: + case FindApproxPath::CT_match_pointer: return out << "match_pointer"; }; diff --git a/panda/src/pgraph/qpfindApproxPath.h b/panda/src/pgraph/findApproxPath.h similarity index 83% rename from panda/src/pgraph/qpfindApproxPath.h rename to panda/src/pgraph/findApproxPath.h index 8c952c3279..ddde9c5cde 100644 --- a/panda/src/pgraph/qpfindApproxPath.h +++ b/panda/src/pgraph/findApproxPath.h @@ -1,4 +1,4 @@ -// Filename: qpqpFindApproxPath.h +// Filename: FindApproxPath.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpFINDAPPROXPATH_H -#define qpFINDAPPROXPATH_H +#ifndef FINDAPPROXPATH_H +#define FINDAPPROXPATH_H #include "pandabase.h" @@ -27,15 +27,15 @@ class PandaNode; //////////////////////////////////////////////////////////////////// -// Class : qpFindApproxPath +// Class : FindApproxPath // Description : This class is local to this package only; it doesn't // get exported. It chops a string path, as supplied to // find_up() or find_down(), and breaks it up into its // component pieces. //////////////////////////////////////////////////////////////////// -class qpFindApproxPath { +class FindApproxPath { public: - INLINE qpFindApproxPath(); + INLINE FindApproxPath(); bool add_string(const string &str_path); bool add_flags(const string &str_flags); @@ -96,25 +96,25 @@ private: bool _return_hidden; bool _return_stashed; -friend ostream &operator << (ostream &, qpFindApproxPath::ComponentType); -friend INLINE ostream &operator << (ostream &, const qpFindApproxPath::Component &); +friend ostream &operator << (ostream &, FindApproxPath::ComponentType); +friend INLINE ostream &operator << (ostream &, const FindApproxPath::Component &); }; ostream & -operator << (ostream &out, qpFindApproxPath::ComponentType type); +operator << (ostream &out, FindApproxPath::ComponentType type); INLINE ostream & -operator << (ostream &out, const qpFindApproxPath::Component &component) { +operator << (ostream &out, const FindApproxPath::Component &component) { component.output(out); return out; } INLINE ostream & -operator << (ostream &out, const qpFindApproxPath &path) { +operator << (ostream &out, const FindApproxPath &path) { path.output(out); return out; } -#include "qpfindApproxPath.I" +#include "findApproxPath.I" #endif diff --git a/panda/src/pgraph/qpfog.I b/panda/src/pgraph/fog.I similarity index 90% rename from panda/src/pgraph/qpfog.I rename to panda/src/pgraph/fog.I index 605e4564c1..4cb6372b10 100644 --- a/panda/src/pgraph/qpfog.I +++ b/panda/src/pgraph/fog.I @@ -1,4 +1,4 @@ -// Filename: qpfog.I +// Filename: fog.I // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,17 +18,17 @@ //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_mode +// Function: Fog::get_mode // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpFog::Mode qpFog:: +INLINE Fog::Mode Fog:: get_mode() const { return _mode; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_mode +// Function: Fog::set_mode // Access: Published // Description: Specifies the computation that is used to determine // the fog effect. If this is M_linear, then the fog @@ -43,27 +43,27 @@ get_mode() const { // doesn't matter to which node the fog object is // parented, or if it is parented anywhere at all. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_mode(Mode mode) { _mode = mode; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_color +// Function: Fog::get_color // Access: Published // Description: Returns the color of the fog. //////////////////////////////////////////////////////////////////// -INLINE const Colorf &qpFog:: +INLINE const Colorf &Fog:: get_color() const { return _color; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_color +// Function: Fog::set_color // Access: Published // Description: Sets the color of the fog. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_color(float r, float g, float b) { _color[0] = r; _color[1] = g; @@ -71,18 +71,18 @@ set_color(float r, float g, float b) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_color +// Function: Fog::set_color // Access: Published // Description: Sets the color of the fog. The alpha component is // not used. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_color(const Colorf &color) { _color = color; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_range +// Function: Fog::set_linear_range // Access: Published // Description: Specifies the effects of the fog in linear distance // units. This is only used if the mode is M_linear. @@ -95,7 +95,7 @@ set_color(const Colorf &color) { // This function also implicitly sets the mode the // M_linear, if it is not already set. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_range(float onset, float opaque) { LVector3f forward = LVector3f::forward(); _linear_onset_point = onset * forward; @@ -106,76 +106,76 @@ set_linear_range(float onset, float opaque) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_linear_onset_point +// Function: Fog::get_linear_onset_point // Access: Published // Description: Returns the point in space at which the fog begins. // This is only used if the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpFog:: +INLINE const LPoint3f &Fog:: get_linear_onset_point() const { return _linear_onset_point; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_onset_point +// Function: Fog::set_linear_onset_point // Access: Published // Description: Specifies the point in space at which the fog begins. // This is only used if the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_onset_point(float x, float y, float z) { _linear_onset_point.set(x, y, z); } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_onset_point +// Function: Fog::set_linear_onset_point // Access: Published // Description: Specifies the point in space at which the fog begins. // This is only used if the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_onset_point(const LPoint3f &linear_onset_point) { _linear_onset_point = linear_onset_point; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_linear_opaque_point +// Function: Fog::get_linear_opaque_point // Access: Published // Description: Returns the point in space at which the fog // completely obscures geometry. This is only used if // the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpFog:: +INLINE const LPoint3f &Fog:: get_linear_opaque_point() const { return _linear_opaque_point; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_opaque_point +// Function: Fog::set_linear_opaque_point // Access: Published // Description: Specifies the point in space at which the fog // completely obscures geometry. This is only used if // the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_opaque_point(float x, float y, float z) { _linear_opaque_point.set(x, y, z); } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_opaque_point +// Function: Fog::set_linear_opaque_point // Access: Published // Description: Specifies the point in space at which the fog // completely obscures geometry. This is only used if // the mode is M_linear. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_opaque_point(const LPoint3f &linear_opaque_point) { _linear_opaque_point = linear_opaque_point; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_linear_fallback +// Function: Fog::set_linear_fallback // Access: Published // Description: Fog effects are traditionally defined in // camera-relative space, but the Panda Fog node has a @@ -214,7 +214,7 @@ set_linear_opaque_point(const LPoint3f &linear_opaque_point) { // hardware when employing the fallback effect. This // supercedes the 3-d onset point and opaque points. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_linear_fallback(float angle, float onset, float opaque) { _linear_fallback_cosa = ccos(deg_2_rad(angle)); _linear_fallback_onset = onset; @@ -222,19 +222,19 @@ set_linear_fallback(float angle, float onset, float opaque) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_exp_density +// Function: Fog::get_exp_density // Access: Published // Description: Returns the density of the fog for exponential // calculations. This is only used if the mode is not // M_linear. //////////////////////////////////////////////////////////////////// -INLINE float qpFog:: +INLINE float Fog:: get_exp_density() const { return _exp_density; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::set_exp_density +// Function: Fog::set_exp_density // Access: Published // Description: Sets the density of the fog for exponential // calculations. This is only used if the mode is not @@ -243,7 +243,7 @@ get_exp_density() const { // If the mode is currently set to M_linear, this // function implicitly sets it to M_exponential. //////////////////////////////////////////////////////////////////// -INLINE void qpFog:: +INLINE void Fog:: set_exp_density(float exp_density) { nassertv((exp_density >= 0.0) && (exp_density <= 1.0)); _exp_density = exp_density; diff --git a/panda/src/pgraph/qpfog.cxx b/panda/src/pgraph/fog.cxx similarity index 87% rename from panda/src/pgraph/qpfog.cxx rename to panda/src/pgraph/fog.cxx index 411c562dd4..9df26fa551 100644 --- a/panda/src/pgraph/qpfog.cxx +++ b/panda/src/pgraph/fog.cxx @@ -1,4 +1,4 @@ -// Filename: qpfog.cxx +// Filename: fog.cxx // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,10 +18,10 @@ #include "pandabase.h" -#include "qpfog.h" +#include "fog.h" #include "mathNumbers.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "transformState.h" #include "bamReader.h" #include "bamWriter.h" @@ -30,18 +30,18 @@ #include -TypeHandle qpFog::_type_handle; +TypeHandle Fog::_type_handle; ostream & -operator << (ostream &out, qpFog::Mode mode) { +operator << (ostream &out, Fog::Mode mode) { switch (mode) { - case qpFog::M_linear: + case Fog::M_linear: return out << "linear"; - case qpFog::M_exponential: + case Fog::M_exponential: return out << "exponential"; - case qpFog::M_exponential_squared: + case Fog::M_exponential_squared: return out << "exponential-squared"; } @@ -49,12 +49,12 @@ operator << (ostream &out, qpFog::Mode mode) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::Constructor +// Function: Fog::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpFog:: -qpFog(const string &name) : +Fog:: +Fog(const string &name) : PandaNode(name) { _mode = M_linear; @@ -70,12 +70,12 @@ qpFog(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpFog::Copy Constructor +// Function: Fog::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpFog:: -qpFog(const qpFog ©) : +Fog:: +Fog(const Fog ©) : PandaNode(copy) { _mode = copy._mode; @@ -91,46 +91,46 @@ qpFog(const qpFog ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpFog::Destructor +// Function: Fog::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpFog:: -~qpFog() { +Fog:: +~Fog() { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::make_copy +// Function: Fog::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpFog:: +PandaNode *Fog:: make_copy() const { - return new qpFog(*this); + return new Fog(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpFog::xform +// Function: Fog::xform // Access: Public, Virtual // Description: Transforms the contents of this node by the indicated // matrix, if it means anything to do so. For most // kinds of nodes, this does nothing. //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: xform(const LMatrix4f &mat) { _linear_onset_point = _linear_onset_point * mat; _linear_opaque_point = _linear_opaque_point * mat; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::output +// Function: Fog::output // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: output(ostream &out) const { out << "fog: " << _mode; switch (_mode) { @@ -147,7 +147,7 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::adjust_to_camera +// Function: Fog::adjust_to_camera // Access: Public // Description: This function is intended to be called by the cull // traverser to compute the appropriate camera-relative @@ -155,7 +155,7 @@ output(ostream &out) const { // position within the scene graph (if linear fog is in // effect). //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: adjust_to_camera(const TransformState *camera_transform) { LVector3f forward = LVector3f::forward(); @@ -163,7 +163,7 @@ adjust_to_camera(const TransformState *camera_transform) { if (get_num_parents() != 0) { // Linear fog is relative to the fog's net transform in the scene // graph. - qpNodePath this_np(this); + NodePath this_np(this); CPT(TransformState) rel_transform = camera_transform->invert_compose(this_np.get_net_transform()); @@ -193,34 +193,34 @@ adjust_to_camera(const TransformState *camera_transform) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::get_linear_range +// Function: Fog::get_linear_range // Access: Public // Description: Retrieves the current onset and offset ranges. //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: get_linear_range(float &onset, float &opaque) { onset = _transformed_onset; opaque = _transformed_opaque; } //////////////////////////////////////////////////////////////////// -// Function: qpFog::register_with_read_factory +// Function: Fog::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpFog. +// Fog. //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpFog::write_datagram +// Function: Fog::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); @@ -235,16 +235,16 @@ write_datagram(BamWriter *manager, Datagram &dg) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::make_from_bam +// Function: Fog::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpFog is encountered -// in the Bam file. It should create the qpFog +// when a new object of type Fog is encountered +// in the Bam file. It should create the Fog // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpFog:: +TypedWritable *Fog:: make_from_bam(const FactoryParams ¶ms) { - qpFog *node = new qpFog(""); + Fog *node = new Fog(""); DatagramIterator scan; BamReader *manager; @@ -255,13 +255,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpFog::fillin +// Function: Fog::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpFog. +// the new Fog. //////////////////////////////////////////////////////////////////// -void qpFog:: +void Fog:: fillin(DatagramIterator &scan, BamReader *manager) { PandaNode::fillin(scan, manager); diff --git a/panda/src/pgraph/qpfog.h b/panda/src/pgraph/fog.h similarity index 92% rename from panda/src/pgraph/qpfog.h rename to panda/src/pgraph/fog.h index 54558a883e..cf1d6c827d 100644 --- a/panda/src/pgraph/qpfog.h +++ b/panda/src/pgraph/fog.h @@ -1,4 +1,4 @@ -// Filename: qpfog.h +// Filename: fog.h // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpFOG_H -#define qpFOG_H +#ifndef FOG_H +#define FOG_H #include "pandabase.h" @@ -47,15 +47,15 @@ class TransformState; // generate traditonal camera-relative fog, as if it // were parented to the camera. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpFog : public PandaNode { +class EXPCL_PANDA Fog : public PandaNode { PUBLISHED: - qpFog(const string &name); + Fog(const string &name); protected: - qpFog(const qpFog ©); + Fog(const Fog ©); public: - virtual ~qpFog(); + virtual ~Fog(); virtual PandaNode *make_copy() const; virtual void xform(const LMatrix4f &mat); @@ -124,7 +124,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpFog", + register_type(_type_handle, "Fog", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -136,13 +136,13 @@ private: static TypeHandle _type_handle; }; -EXPCL_PANDA ostream &operator << (ostream &out, qpFog::Mode mode); +EXPCL_PANDA ostream &operator << (ostream &out, Fog::Mode mode); -INLINE ostream &operator << (ostream &out, const qpFog &fog) { +INLINE ostream &operator << (ostream &out, const Fog &fog) { fog.output(out); return out; } -#include "qpfog.I" +#include "fog.I" #endif diff --git a/panda/src/pgraph/fogAttrib.I b/panda/src/pgraph/fogAttrib.I index be10c6706c..947e99dd66 100644 --- a/panda/src/pgraph/fogAttrib.I +++ b/panda/src/pgraph/fogAttrib.I @@ -35,7 +35,7 @@ FogAttrib() { //////////////////////////////////////////////////////////////////// INLINE bool FogAttrib:: is_off() const { - return _fog == (const qpFog *)NULL; + return _fog == (const Fog *)NULL; } //////////////////////////////////////////////////////////////////// @@ -45,7 +45,7 @@ is_off() const { // returns the fog that is associated. Otherwise, // return NULL. //////////////////////////////////////////////////////////////////// -INLINE qpFog *FogAttrib:: +INLINE Fog *FogAttrib:: get_fog() const { return _fog; } diff --git a/panda/src/pgraph/fogAttrib.cxx b/panda/src/pgraph/fogAttrib.cxx index 9929cc64f7..60a94945a7 100644 --- a/panda/src/pgraph/fogAttrib.cxx +++ b/panda/src/pgraph/fogAttrib.cxx @@ -32,7 +32,7 @@ TypeHandle FogAttrib::_type_handle; // rendering the indicated fog onto geometry. //////////////////////////////////////////////////////////////////// CPT(RenderAttrib) FogAttrib:: -make(qpFog *fog) { +make(Fog *fog) { FogAttrib *attrib = new FogAttrib; attrib->_fog = fog; return return_new(attrib); @@ -161,7 +161,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { TypedWritable *fog = p_list[pi++]; if (fog != (TypedWritable *)NULL) { - _fog = DCAST(qpFog, fog); + _fog = DCAST(Fog, fog); } return pi; diff --git a/panda/src/pgraph/fogAttrib.h b/panda/src/pgraph/fogAttrib.h index af91a7d99e..becdb0bbff 100644 --- a/panda/src/pgraph/fogAttrib.h +++ b/panda/src/pgraph/fogAttrib.h @@ -22,7 +22,7 @@ #include "pandabase.h" #include "renderAttrib.h" -#include "qpfog.h" +#include "fog.h" //////////////////////////////////////////////////////////////////// // Class : FogAttrib @@ -33,11 +33,11 @@ private: INLINE FogAttrib(); PUBLISHED: - static CPT(RenderAttrib) make(qpFog *fog); + static CPT(RenderAttrib) make(Fog *fog); static CPT(RenderAttrib) make_off(); INLINE bool is_off() const; - INLINE qpFog *get_fog() const; + INLINE Fog *get_fog() const; public: virtual void issue(GraphicsStateGuardianBase *gsg) const; @@ -48,7 +48,7 @@ protected: virtual RenderAttrib *make_default_impl() const; private: - PT(qpFog) _fog; + PT(Fog) _fog; public: static void register_with_read_factory(); diff --git a/panda/src/pgraph/qpgeomNode.I b/panda/src/pgraph/geomNode.I similarity index 87% rename from panda/src/pgraph/qpgeomNode.I rename to panda/src/pgraph/geomNode.I index 5807b4f96d..fd8a1b6841 100644 --- a/panda/src/pgraph/qpgeomNode.I +++ b/panda/src/pgraph/geomNode.I @@ -1,4 +1,4 @@ -// Filename: qpgeomNode.I +// Filename: geomNode.I // Created by: drose (23Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,11 +18,11 @@ //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::GeomEntry::Constructor +// Function: GeomNode::GeomEntry::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpGeomNode::GeomEntry:: +INLINE GeomNode::GeomEntry:: GeomEntry(Geom *geom, const RenderState *state) : _geom(geom), _state(state) @@ -30,31 +30,31 @@ GeomEntry(Geom *geom, const RenderState *state) : } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::Constructor +// Function: GeomNode::CData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpGeomNode::CData:: +INLINE GeomNode::CData:: CData() { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::get_num_geoms +// Function: GeomNode::get_num_geoms // Access: Public // Description: Returns the number of geoms in the node. //////////////////////////////////////////////////////////////////// -INLINE int qpGeomNode:: +INLINE int GeomNode:: get_num_geoms() const { CDReader cdata(_cycler); return cdata->_geoms.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::get_geom +// Function: GeomNode::get_geom // Access: Public // Description: Returns the nth geom of the node. //////////////////////////////////////////////////////////////////// -INLINE Geom *qpGeomNode:: +INLINE Geom *GeomNode:: get_geom(int n) const { CDReader cdata(_cycler); nassertr(n >= 0 && n < (int)cdata->_geoms.size(), NULL); @@ -62,7 +62,7 @@ get_geom(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::get_geom_state +// Function: GeomNode::get_geom_state // Access: Public // Description: Returns the RenderState associated with the nth geom // of the node. This is just the RenderState directly @@ -71,7 +71,7 @@ get_geom(int n) const { // RenderStates that appear on the scene graph in nodes // above this GeomNode. //////////////////////////////////////////////////////////////////// -INLINE const RenderState *qpGeomNode:: +INLINE const RenderState *GeomNode:: get_geom_state(int n) const { CDReader cdata(_cycler); nassertr(n >= 0 && n < (int)cdata->_geoms.size(), NULL); @@ -79,7 +79,7 @@ get_geom_state(int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::set_geom_state +// Function: GeomNode::set_geom_state // Access: Public // Description: Changes the RenderState associated with the nth geom // of the node. This is just the RenderState directly @@ -88,7 +88,7 @@ get_geom_state(int n) const { // RenderStates that appear on the scene graph in nodes // above this GeomNode. //////////////////////////////////////////////////////////////////// -INLINE void qpGeomNode:: +INLINE void GeomNode:: set_geom_state(int n, const RenderState *state) { CDWriter cdata(_cycler); nassertv(n >= 0 && n < (int)cdata->_geoms.size()); @@ -96,7 +96,7 @@ set_geom_state(int n, const RenderState *state) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::add_geom +// Function: GeomNode::add_geom // Access: Published // Description: Adds a new Geom to the node. The geom is given the // indicated state (which may be @@ -105,7 +105,7 @@ set_geom_state(int n, const RenderState *state) { // // The return value is the index number of the new Geom. //////////////////////////////////////////////////////////////////// -INLINE int qpGeomNode:: +INLINE int GeomNode:: add_geom(Geom *geom, const RenderState *state) { nassertr(geom != (Geom *)NULL, -1); nassertr(state != (RenderState *)NULL, -1); @@ -117,11 +117,11 @@ add_geom(Geom *geom, const RenderState *state) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::remove_geom +// Function: GeomNode::remove_geom // Access: Published // Description: Removes the nth geom from the node. //////////////////////////////////////////////////////////////////// -INLINE void qpGeomNode:: +INLINE void GeomNode:: remove_geom(int n) { CDWriter cdata(_cycler); nassertv(n >= 0 && n < (int)cdata->_geoms.size()); @@ -131,11 +131,11 @@ remove_geom(int n) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::remove_all_geoms +// Function: GeomNode::remove_all_geoms // Access: Published // Description: Removes all the geoms from the node at once. //////////////////////////////////////////////////////////////////// -INLINE void qpGeomNode:: +INLINE void GeomNode:: remove_all_geoms() { CDWriter cdata(_cycler); cdata->_geoms.clear(); diff --git a/panda/src/pgraph/qpgeomNode.cxx b/panda/src/pgraph/geomNode.cxx similarity index 85% rename from panda/src/pgraph/qpgeomNode.cxx rename to panda/src/pgraph/geomNode.cxx index 7258fe920a..ed36335b46 100644 --- a/panda/src/pgraph/qpgeomNode.cxx +++ b/panda/src/pgraph/geomNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpgeomNode.cxx +// Filename: geomNode.cxx // Created by: drose (23Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,44 +16,44 @@ // //////////////////////////////////////////////////////////////////// -#include "qpgeomNode.h" -#include "qpgeomTransformer.h" +#include "geomNode.h" +#include "geomTransformer.h" #include "bamReader.h" #include "bamWriter.h" #include "datagram.h" #include "datagramIterator.h" #include "indent.h" -TypeHandle qpGeomNode::_type_handle; +TypeHandle GeomNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::Copy Constructor +// Function: GeomNode::CData::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpGeomNode::CData:: -CData(const qpGeomNode::CData ©) : +GeomNode::CData:: +CData(const GeomNode::CData ©) : _geoms(copy._geoms) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::make_copy +// Function: GeomNode::CData::make_copy // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -CycleData *qpGeomNode::CData:: +CycleData *GeomNode::CData:: make_copy() const { return new CData(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::write_datagram +// Function: GeomNode::CData::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpGeomNode::CData:: +void GeomNode::CData:: write_datagram(BamWriter *manager, Datagram &dg) const { int num_geoms = _geoms.size(); nassertv(num_geoms == (int)(PN_uint16)num_geoms); @@ -68,13 +68,13 @@ write_datagram(BamWriter *manager, Datagram &dg) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::complete_pointers +// Function: GeomNode::CData::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpGeomNode::CData:: +int GeomNode::CData:: complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = CycleData::complete_pointers(p_list, manager); @@ -90,13 +90,13 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::CData::fillin +// Function: GeomNode::CData::fillin // Access: Public, Virtual // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpGeomNode. +// the new GeomNode. //////////////////////////////////////////////////////////////////// -void qpGeomNode::CData:: +void GeomNode::CData:: fillin(DatagramIterator &scan, BamReader *manager) { int num_geoms = scan.get_uint16(); // Read the list of geoms and states. Push back a NULL for each one. @@ -109,39 +109,39 @@ fillin(DatagramIterator &scan, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::Constructor +// Function: GeomNode::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpGeomNode:: -qpGeomNode(const string &name) : +GeomNode:: +GeomNode(const string &name) : PandaNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::Copy Constructor +// Function: GeomNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpGeomNode:: -qpGeomNode(const qpGeomNode ©) : +GeomNode:: +GeomNode(const GeomNode ©) : PandaNode(copy), _cycler(copy._cycler) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::Destructor +// Function: GeomNode::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpGeomNode:: -~qpGeomNode() { +GeomNode:: +~GeomNode() { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::make_copy +// Function: GeomNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated PandaNode that is a shallow // copy of this one. It will be a different pointer, @@ -149,13 +149,13 @@ qpGeomNode:: // that of the original PandaNode. No children will be // copied. //////////////////////////////////////////////////////////////////// -PandaNode *qpGeomNode:: +PandaNode *GeomNode:: make_copy() const { - return new qpGeomNode(*this); + return new GeomNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::xform +// Function: GeomNode::xform // Access: Public, Virtual // Description: Transforms the contents of this node by the indicated // matrix, if it means anything to do so. For most @@ -166,14 +166,14 @@ make_copy() const { // will share the new arrays properly between different // GeomNodes. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: xform(const LMatrix4f &mat) { - qpGeomTransformer transformer; + GeomTransformer transformer; transformer.transform_vertices(this, mat); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::combine_with +// Function: GeomNode::combine_with // Access: Public, Virtual // Description: Collapses this node with the other node, if possible, // and returns a pointer to the combined node, or NULL @@ -187,12 +187,12 @@ xform(const LMatrix4f &mat) { // decide whether to collapse the two nodes and what the // collapsed node should look like. //////////////////////////////////////////////////////////////////// -PandaNode *qpGeomNode:: +PandaNode *GeomNode:: combine_with(PandaNode *other) { if (is_exact_type(get_class_type()) && other->is_exact_type(get_class_type())) { // Two GeomNodes can combine by moving Geoms from one to the other. - qpGeomNode *gother = DCAST(qpGeomNode, other); + GeomNode *gother = DCAST(GeomNode, other); add_geoms_from(gother); return this; } @@ -201,13 +201,13 @@ combine_with(PandaNode *other) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::add_geoms_from +// Function: GeomNode::add_geoms_from // Access: Published // Description: Copies the Geoms (and their associated RenderStates) // from the indicated GeomNode into this one. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: -add_geoms_from(const qpGeomNode *other) { +void GeomNode:: +add_geoms_from(const GeomNode *other) { CDReader cdata_other(other->_cycler); CDWriter cdata(_cycler); @@ -222,12 +222,12 @@ add_geoms_from(const qpGeomNode *other) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::write_geoms +// Function: GeomNode::write_geoms // Access: Published // Description: Writes a short description of all the Geoms in the // node. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: write_geoms(ostream &out, int indent_level) const { CDReader cdata(_cycler); write(out, indent_level); @@ -240,12 +240,12 @@ write_geoms(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::write_verbose +// Function: GeomNode::write_verbose // Access: Published // Description: Writes a detailed description of all the Geoms in the // node. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: write_verbose(ostream &out, int indent_level) const { CDReader cdata(_cycler); write(out, indent_level); @@ -259,18 +259,18 @@ write_verbose(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::output +// Function: GeomNode::output // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: output(ostream &out) const { PandaNode::output(out); out << " (" << get_num_geoms() << " geoms)"; } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::is_geom_node +// Function: GeomNode::is_geom_node // Access: Public, Virtual // Description: A simple downcast check. Returns true if this kind // of node happens to inherit from GeomNode, false @@ -280,20 +280,20 @@ output(ostream &out) const { // is_of_type(GeomNode::get_class_type()), since this // test is so important to rendering. //////////////////////////////////////////////////////////////////// -bool qpGeomNode:: +bool GeomNode:: is_geom_node() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::recompute_internal_bound +// Function: GeomNode::recompute_internal_bound // Access: Protected, Virtual // Description: Called when needed to recompute the node's // _internal_bound object. Nodes that contain anything // of substance should redefine this to do the right // thing. //////////////////////////////////////////////////////////////////// -BoundingVolume *qpGeomNode:: +BoundingVolume *GeomNode:: recompute_internal_bound() { // First, get ourselves a fresh, empty bounding volume. BoundingVolume *bound = PandaNode::recompute_internal_bound(); @@ -318,39 +318,39 @@ recompute_internal_bound() { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::register_with_read_factory +// Function: GeomNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpGeomNode. +// GeomNode. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::write_datagram +// Function: GeomNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); manager->write_cdata(dg, _cycler); } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::make_from_bam +// Function: GeomNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpGeomNode is encountered -// in the Bam file. It should create the qpGeomNode +// when a new object of type GeomNode is encountered +// in the Bam file. It should create the GeomNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpGeomNode:: +TypedWritable *GeomNode:: make_from_bam(const FactoryParams ¶ms) { - qpGeomNode *node = new qpGeomNode(""); + GeomNode *node = new GeomNode(""); DatagramIterator scan; BamReader *manager; @@ -361,13 +361,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomNode::fillin +// Function: GeomNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpGeomNode. +// the new GeomNode. //////////////////////////////////////////////////////////////////// -void qpGeomNode:: +void GeomNode:: fillin(DatagramIterator &scan, BamReader *manager) { PandaNode::fillin(scan, manager); manager->read_cdata(scan, _cycler); diff --git a/panda/src/pgraph/qpgeomNode.h b/panda/src/pgraph/geomNode.h similarity index 90% rename from panda/src/pgraph/qpgeomNode.h rename to panda/src/pgraph/geomNode.h index 497797e4b4..5654b313e1 100644 --- a/panda/src/pgraph/qpgeomNode.h +++ b/panda/src/pgraph/geomNode.h @@ -1,4 +1,4 @@ -// Filename: qpgeomNode.h +// Filename: geomNode.h // Created by: drose (22Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpGEOMNODE_H -#define qpGEOMNODE_H +#ifndef GEOMNODE_H +#define GEOMNODE_H #include "pandabase.h" @@ -35,14 +35,14 @@ // the scene graph; almost all visible objects will be // contained in a GeomNode somewhere. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpGeomNode : public PandaNode { +class EXPCL_PANDA GeomNode : public PandaNode { PUBLISHED: - qpGeomNode(const string &name); + GeomNode(const string &name); protected: - qpGeomNode(const qpGeomNode ©); + GeomNode(const GeomNode ©); public: - virtual ~qpGeomNode(); + virtual ~GeomNode(); virtual PandaNode *make_copy() const; virtual void xform(const LMatrix4f &mat); virtual PandaNode *combine_with(PandaNode *other); @@ -54,7 +54,7 @@ PUBLISHED: INLINE void set_geom_state(int n, const RenderState *state); INLINE int add_geom(Geom *geom, const RenderState *state = RenderState::make_empty()); - void add_geoms_from(const qpGeomNode *other); + void add_geoms_from(const GeomNode *other); INLINE void remove_geom(int n); INLINE void remove_all_geoms(); @@ -109,7 +109,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpGeomNode", + register_type(_type_handle, "GeomNode", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -121,9 +121,9 @@ private: static TypeHandle _type_handle; friend class PandaNode::Children; - friend class qpGeomTransformer; + friend class GeomTransformer; }; -#include "qpgeomNode.I" +#include "geomNode.I" #endif diff --git a/panda/src/pgraph/qpgeomTransformer.I b/panda/src/pgraph/geomTransformer.I similarity index 70% rename from panda/src/pgraph/qpgeomTransformer.I rename to panda/src/pgraph/geomTransformer.I index e1b5bb7988..007ddb66f8 100644 --- a/panda/src/pgraph/qpgeomTransformer.I +++ b/panda/src/pgraph/geomTransformer.I @@ -1,4 +1,4 @@ -// Filename: qpgeomTransformer.I +// Filename: geomTransformer.I // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,12 +18,12 @@ //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::SourceVertices::Ordering Operator +// Function: GeomTransformer::SourceVertices::Ordering Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpGeomTransformer::SourceVertices:: -operator < (const qpGeomTransformer::SourceVertices &other) const { +INLINE bool GeomTransformer::SourceVertices:: +operator < (const GeomTransformer::SourceVertices &other) const { if (_coords != other._coords) { return _coords < other._coords; } @@ -31,12 +31,12 @@ operator < (const qpGeomTransformer::SourceVertices &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::SourceNormals::Ordering Operator +// Function: GeomTransformer::SourceNormals::Ordering Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpGeomTransformer::SourceNormals:: -operator < (const qpGeomTransformer::SourceNormals &other) const { +INLINE bool GeomTransformer::SourceNormals:: +operator < (const GeomTransformer::SourceNormals &other) const { if (_norms != other._norms) { return _norms < other._norms; } @@ -44,12 +44,12 @@ operator < (const qpGeomTransformer::SourceNormals &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::SourceTexCoords::Ordering Operator +// Function: GeomTransformer::SourceTexCoords::Ordering Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpGeomTransformer::SourceTexCoords:: -operator < (const qpGeomTransformer::SourceTexCoords &other) const { +INLINE bool GeomTransformer::SourceTexCoords:: +operator < (const GeomTransformer::SourceTexCoords &other) const { if (_texcoords != other._texcoords) { return _texcoords < other._texcoords; } @@ -57,12 +57,12 @@ operator < (const qpGeomTransformer::SourceTexCoords &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::SourceColors::Ordering Operator +// Function: GeomTransformer::SourceColors::Ordering Operator // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpGeomTransformer::SourceColors:: -operator < (const qpGeomTransformer::SourceColors &other) const { +INLINE bool GeomTransformer::SourceColors:: +operator < (const GeomTransformer::SourceColors &other) const { if (_colors != other._colors) { return _colors < other._colors; } diff --git a/panda/src/pgraph/qpgeomTransformer.cxx b/panda/src/pgraph/geomTransformer.cxx similarity index 79% rename from panda/src/pgraph/qpgeomTransformer.cxx rename to panda/src/pgraph/geomTransformer.cxx index d767170b88..f573ec447c 100644 --- a/panda/src/pgraph/qpgeomTransformer.cxx +++ b/panda/src/pgraph/geomTransformer.cxx @@ -1,4 +1,4 @@ -// Filename: qpgeomTransformer.cxx +// Filename: geomTransformer.cxx // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,36 +16,36 @@ // //////////////////////////////////////////////////////////////////// -#include "qpgeomTransformer.h" -#include "qpgeomNode.h" +#include "geomTransformer.h" +#include "geomNode.h" #include "renderState.h" //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::Constructor +// Function: GeomTransformer::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpGeomTransformer:: -qpGeomTransformer() { +GeomTransformer:: +GeomTransformer() { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::Destructor +// Function: GeomTransformer::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpGeomTransformer:: -~qpGeomTransformer() { +GeomTransformer:: +~GeomTransformer() { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_vertices +// Function: GeomTransformer::transform_vertices // Access: Public // Description: Transforms the vertices and the normals in the // indicated Geom by the indicated matrix. Returns true // if the Geom was changed, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: +bool GeomTransformer:: transform_vertices(Geom *geom, const LMatrix4f &mat) { bool transformed = false; @@ -113,24 +113,24 @@ transform_vertices(Geom *geom, const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_vertices +// Function: GeomTransformer::transform_vertices // Access: Public // Description: Transforms the vertices and the normals in all of the -// Geoms within the indicated qpGeomNode by the indicated +// Geoms within the indicated GeomNode by the indicated // matrix. Does not destructively change Geoms; // instead, a copy will be made of each Geom to be -// changed, in case multiple qpGeomNodes reference the -// same Geom. Returns true if the qpGeomNode was changed, +// changed, in case multiple GeomNodes reference the +// same Geom. Returns true if the GeomNode was changed, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: -transform_vertices(qpGeomNode *node, const LMatrix4f &mat) { +bool GeomTransformer:: +transform_vertices(GeomNode *node, const LMatrix4f &mat) { bool any_changed = false; - qpGeomNode::CDWriter cdata(node->_cycler); - qpGeomNode::Geoms::iterator gi; + GeomNode::CDWriter cdata(node->_cycler); + GeomNode::Geoms::iterator gi; for (gi = cdata->_geoms.begin(); gi != cdata->_geoms.end(); ++gi) { - qpGeomNode::GeomEntry &entry = (*gi); + GeomNode::GeomEntry &entry = (*gi); PT(Geom) new_geom = entry._geom->make_copy(); if (transform_vertices(new_geom, mat)) { entry._geom = new_geom; @@ -143,13 +143,13 @@ transform_vertices(qpGeomNode *node, const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_texcoords +// Function: GeomTransformer::transform_texcoords // Access: Public // Description: Transforms the texture coordinates in the indicated // Geom by the indicated matrix. Returns true if the // Geom was changed, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: +bool GeomTransformer:: transform_texcoords(Geom *geom, const LMatrix4f &mat) { bool transformed = false; @@ -192,24 +192,24 @@ transform_texcoords(Geom *geom, const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_texcoords +// Function: GeomTransformer::transform_texcoords // Access: Public // Description: Transforms the texture coordinates in all of the -// Geoms within the indicated qpGeomNode by the indicated +// Geoms within the indicated GeomNode by the indicated // matrix. Does not destructively change Geoms; // instead, a copy will be made of each Geom to be -// changed, in case multiple qpGeomNodes reference the -// same Geom. Returns true if the qpGeomNode was changed, +// changed, in case multiple GeomNodes reference the +// same Geom. Returns true if the GeomNode was changed, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: -transform_texcoords(qpGeomNode *node, const LMatrix4f &mat) { +bool GeomTransformer:: +transform_texcoords(GeomNode *node, const LMatrix4f &mat) { bool any_changed = false; - qpGeomNode::CDWriter cdata(node->_cycler); - qpGeomNode::Geoms::iterator gi; + GeomNode::CDWriter cdata(node->_cycler); + GeomNode::Geoms::iterator gi; for (gi = cdata->_geoms.begin(); gi != cdata->_geoms.end(); ++gi) { - qpGeomNode::GeomEntry &entry = (*gi); + GeomNode::GeomEntry &entry = (*gi); PT(Geom) new_geom = entry._geom->make_copy(); if (transform_texcoords(new_geom, mat)) { entry._geom = new_geom; @@ -222,13 +222,13 @@ transform_texcoords(qpGeomNode *node, const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::set_color +// Function: GeomTransformer::set_color // Access: Public // Description: Overrides the color indicated within the Geom with // the given replacement color. Returns true if the // Geom was changed, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: +bool GeomTransformer:: set_color(Geom *geom, const Colorf &color) { // In this case, we always replace whatever color array was there // with a new color array containing just this color. @@ -247,21 +247,21 @@ set_color(Geom *geom, const Colorf &color) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_texcoords +// Function: GeomTransformer::transform_texcoords // Access: Public -// Description: Overrides the color indicated within the qpGeomNode +// Description: Overrides the color indicated within the GeomNode // with the given replacement color. Returns true if -// any Geom in the qpGeomNode was changed, false +// any Geom in the GeomNode was changed, false // otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: -set_color(qpGeomNode *node, const Colorf &color) { +bool GeomTransformer:: +set_color(GeomNode *node, const Colorf &color) { bool any_changed = false; - qpGeomNode::CDWriter cdata(node->_cycler); - qpGeomNode::Geoms::iterator gi; + GeomNode::CDWriter cdata(node->_cycler); + GeomNode::Geoms::iterator gi; for (gi = cdata->_geoms.begin(); gi != cdata->_geoms.end(); ++gi) { - qpGeomNode::GeomEntry &entry = (*gi); + GeomNode::GeomEntry &entry = (*gi); PT(Geom) new_geom = entry._geom->make_copy(); if (set_color(new_geom, color)) { entry._geom = new_geom; @@ -273,13 +273,13 @@ set_color(qpGeomNode *node, const Colorf &color) { } //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_colors +// Function: GeomTransformer::transform_colors // Access: Public // Description: Transforms the colors in the indicated Geom by the // indicated scale. Returns true if the Geom was // changed, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: +bool GeomTransformer:: transform_colors(Geom *geom, const LVecBase4f &scale) { bool transformed = false; @@ -324,23 +324,23 @@ transform_colors(Geom *geom, const LVecBase4f &scale) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::transform_colors +// Function: GeomTransformer::transform_colors // Access: Public // Description: Transforms the colors in all of the Geoms within the -// indicated qpGeomNode by the indicated scale. Does +// indicated GeomNode by the indicated scale. Does // not destructively change Geoms; instead, a copy will // be made of each Geom to be changed, in case multiple -// qpGeomNodes reference the same Geom. Returns true if -// the qpGeomNode was changed, false otherwise. +// GeomNodes reference the same Geom. Returns true if +// the GeomNode was changed, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: -transform_colors(qpGeomNode *node, const LVecBase4f &scale) { +bool GeomTransformer:: +transform_colors(GeomNode *node, const LVecBase4f &scale) { bool any_changed = false; - qpGeomNode::CDWriter cdata(node->_cycler); - qpGeomNode::Geoms::iterator gi; + GeomNode::CDWriter cdata(node->_cycler); + GeomNode::Geoms::iterator gi; for (gi = cdata->_geoms.begin(); gi != cdata->_geoms.end(); ++gi) { - qpGeomNode::GeomEntry &entry = (*gi); + GeomNode::GeomEntry &entry = (*gi); PT(Geom) new_geom = entry._geom->make_copy(); if (transform_colors(new_geom, scale)) { entry._geom = new_geom; @@ -353,20 +353,20 @@ transform_colors(qpGeomNode *node, const LVecBase4f &scale) { //////////////////////////////////////////////////////////////////// -// Function: qpGeomTransformer::apply_state +// Function: GeomTransformer::apply_state // Access: Public // Description: Applies the indicated render state to all the of // Geoms. Returns true if the GeomNode was changed, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpGeomTransformer:: -apply_state(qpGeomNode *node, const RenderState *state) { +bool GeomTransformer:: +apply_state(GeomNode *node, const RenderState *state) { bool any_changed = false; - qpGeomNode::CDWriter cdata(node->_cycler); - qpGeomNode::Geoms::iterator gi; + GeomNode::CDWriter cdata(node->_cycler); + GeomNode::Geoms::iterator gi; for (gi = cdata->_geoms.begin(); gi != cdata->_geoms.end(); ++gi) { - qpGeomNode::GeomEntry &entry = (*gi); + GeomNode::GeomEntry &entry = (*gi); CPT(RenderState) new_state = state->compose(entry._state); if (entry._state != new_state) { entry._state = new_state; diff --git a/panda/src/pgraph/qpgeomTransformer.h b/panda/src/pgraph/geomTransformer.h similarity index 82% rename from panda/src/pgraph/qpgeomTransformer.h rename to panda/src/pgraph/geomTransformer.h index af38550c74..8102ac63f8 100644 --- a/panda/src/pgraph/qpgeomTransformer.h +++ b/panda/src/pgraph/geomTransformer.h @@ -1,4 +1,4 @@ -// Filename: qpgeomTransformer.h +// Filename: geomTransformer.h // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,18 +16,18 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpGEOMTRANSFORMER_H -#define qpGEOMTRANSFORMER_H +#ifndef GEOMTRANSFORMER_H +#define GEOMTRANSFORMER_H #include "pandabase.h" #include "geom.h" #include "luse.h" -class qpGeomNode; +class GeomNode; /////////////////////////////////////////////////////////////////// -// Class : qpGeomTransformer +// Class : GeomTransformer // Description : An object specifically designed to transform the // vertices of a Geom without disturbing indexing or // affecting any other Geoms that may share the same @@ -35,31 +35,31 @@ class qpGeomNode; // when different Geoms sharing the same vertex arrays // are transformed by the same amount. // -// If you create a single qpGeomTransformer and use it to +// If you create a single GeomTransformer and use it to // transform a number of different Geoms by various // transformations, then those Geoms which happen to // share the same arrays and are transformed by the same // amounts will still share the same arrays as each // other (but different from the original arrays). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpGeomTransformer { +class EXPCL_PANDA GeomTransformer { public: - qpGeomTransformer(); - ~qpGeomTransformer(); + GeomTransformer(); + ~GeomTransformer(); bool transform_vertices(Geom *geom, const LMatrix4f &mat); - bool transform_vertices(qpGeomNode *node, const LMatrix4f &mat); + bool transform_vertices(GeomNode *node, const LMatrix4f &mat); bool transform_texcoords(Geom *geom, const LMatrix4f &mat); - bool transform_texcoords(qpGeomNode *node, const LMatrix4f &mat); + bool transform_texcoords(GeomNode *node, const LMatrix4f &mat); bool set_color(Geom *geom, const Colorf &color); - bool set_color(qpGeomNode *node, const Colorf &color); + bool set_color(GeomNode *node, const Colorf &color); bool transform_colors(Geom *geom, const LVecBase4f &scale); - bool transform_colors(qpGeomNode *node, const LVecBase4f &scale); + bool transform_colors(GeomNode *node, const LVecBase4f &scale); - bool apply_state(qpGeomNode *node, const RenderState *state); + bool apply_state(GeomNode *node, const RenderState *state); private: class SourceVertices { @@ -110,7 +110,7 @@ private: TColors _tcolors; }; -#include "qpgeomTransformer.I" +#include "geomTransformer.I" #endif diff --git a/panda/src/pgraph/qplensNode.I b/panda/src/pgraph/lensNode.I similarity index 78% rename from panda/src/pgraph/qplensNode.I rename to panda/src/pgraph/lensNode.I index 5f35d0fa64..1e4ff3cfb1 100644 --- a/panda/src/pgraph/qplensNode.I +++ b/panda/src/pgraph/lensNode.I @@ -1,4 +1,4 @@ -// Filename: qplensNode.I +// Filename: lensNode.I // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -20,12 +20,12 @@ //////////////////////////////////////////////////////////////////// // Function: copy_lens // Access: Public -// Description: Sets up the qpLensNode using a copy of the +// Description: Sets up the LensNode using a copy of the // indicated Lens. If the original Lens is -// changed or destroyed, this qpLensNode is not +// changed or destroyed, this LensNode is not // affected. //////////////////////////////////////////////////////////////////// -INLINE void qpLensNode:: +INLINE void LensNode:: copy_lens(const Lens &lens) { _lens = lens.make_copy(); } @@ -33,11 +33,11 @@ copy_lens(const Lens &lens) { //////////////////////////////////////////////////////////////////// // Function: set_lens // Access: Public -// Description: Sets up the qpLensNode using this particular Lens +// Description: Sets up the LensNode using this particular Lens // pointer. If the lens is subsequently modified, the -// qpLensNode properties immediately reflect the change. +// LensNode properties immediately reflect the change. //////////////////////////////////////////////////////////////////// -INLINE void qpLensNode:: +INLINE void LensNode:: set_lens(Lens *lens) { _lens = lens; } @@ -46,10 +46,10 @@ set_lens(Lens *lens) { // Function: get_lens // Access: Public // Description: Returns a pointer to the particular Lens -// associated with this qpLensNode, or NULL if there is +// associated with this LensNode, or NULL if there is // not yet a Lens associated. //////////////////////////////////////////////////////////////////// -INLINE Lens *qpLensNode:: +INLINE Lens *LensNode:: get_lens() const { return _lens; } diff --git a/panda/src/pgraph/qplensNode.cxx b/panda/src/pgraph/lensNode.cxx similarity index 81% rename from panda/src/pgraph/qplensNode.cxx rename to panda/src/pgraph/lensNode.cxx index 41d3f495c2..c315216a13 100644 --- a/panda/src/pgraph/qplensNode.cxx +++ b/panda/src/pgraph/lensNode.cxx @@ -1,4 +1,4 @@ -// Filename: qplensNode.cxx +// Filename: lensNode.cxx // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,72 +16,72 @@ // //////////////////////////////////////////////////////////////////// -#include "qplensNode.h" +#include "lensNode.h" #include "geometricBoundingVolume.h" #include "bamWriter.h" #include "bamReader.h" #include "datagram.h" #include "datagramIterator.h" -TypeHandle qpLensNode::_type_handle; +TypeHandle LensNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::Constructor +// Function: LensNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpLensNode:: -qpLensNode(const string &name) : +LensNode:: +LensNode(const string &name) : PandaNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::Copy Constructor +// Function: LensNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpLensNode:: -qpLensNode(const qpLensNode ©) : +LensNode:: +LensNode(const LensNode ©) : PandaNode(copy), _lens(copy._lens) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::xform +// Function: LensNode::xform // Access: Public, Virtual // Description: Transforms the contents of this PandaNode by the // indicated matrix, if it means anything to do so. For // most kinds of PandaNodes, this does nothing. //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: xform(const LMatrix4f &mat) { PandaNode::xform(mat); // We need to actually transform the lens here. } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::make_copy +// Function: LensNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpLensNode:: +PandaNode *LensNode:: make_copy() const { - return new qpLensNode(*this); + return new LensNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::is_in_view +// Function: LensNode::is_in_view // Access: Public // Description: Returns true if the given point is within the bounds -// of the lens of the qpLensNode (i.e. if the camera can +// of the lens of the LensNode (i.e. if the camera can // see the point). //////////////////////////////////////////////////////////////////// -bool qpLensNode:: +bool LensNode:: is_in_view(const LPoint3f &pos) { PT(BoundingVolume) bv = _lens->make_bounds(); if (bv == NULL) { @@ -93,11 +93,11 @@ is_in_view(const LPoint3f &pos) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::output +// Function: LensNode::output // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: output(ostream &out) const { PandaNode::output(out); if (_lens != (Lens *)NULL) { @@ -108,11 +108,11 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::write +// Function: LensNode::write // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: write(ostream &out, int indent_level) const { PandaNode::write(out, indent_level); if (_lens != (Lens *)NULL) { @@ -121,23 +121,23 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::register_with_read_factory +// Function: LensNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpLensNode. +// LensNode. //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::write_datagram +// Function: LensNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); @@ -146,13 +146,13 @@ write_datagram(BamWriter *manager, Datagram &dg) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::complete_pointers +// Function: LensNode::complete_pointers // Access: Public, Virtual // Description: Receives an array of pointers, one for each time // manager->read_pointer() was called in fillin(). // Returns the number of pointers processed. //////////////////////////////////////////////////////////////////// -int qpLensNode:: +int LensNode:: complete_pointers(TypedWritable **p_list, BamReader *manager) { int pi = PandaNode::complete_pointers(p_list, manager); @@ -160,16 +160,16 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::make_from_bam +// Function: LensNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpLensNode is encountered -// in the Bam file. It should create the qpLensNode +// when a new object of type LensNode is encountered +// in the Bam file. It should create the LensNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpLensNode:: +TypedWritable *LensNode:: make_from_bam(const FactoryParams ¶ms) { - qpLensNode *node = new qpLensNode(""); + LensNode *node = new LensNode(""); DatagramIterator scan; BamReader *manager; @@ -180,13 +180,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpLensNode::fillin +// Function: LensNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpLensNode. +// the new LensNode. //////////////////////////////////////////////////////////////////// -void qpLensNode:: +void LensNode:: fillin(DatagramIterator &scan, BamReader *manager) { PandaNode::fillin(scan, manager); } diff --git a/panda/src/pgraph/qplensNode.h b/panda/src/pgraph/lensNode.h similarity index 88% rename from panda/src/pgraph/qplensNode.h rename to panda/src/pgraph/lensNode.h index 63bd2cf0bf..c580bad773 100644 --- a/panda/src/pgraph/qplensNode.h +++ b/panda/src/pgraph/lensNode.h @@ -1,4 +1,4 @@ -// Filename: qplensNode.h +// Filename: lensNode.h // Created by: drose (26Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpLENSNODE_H -#define qpLENSNODE_H +#ifndef LENSNODE_H +#define LENSNODE_H #include "pandabase.h" @@ -26,18 +26,18 @@ #include "pointerTo.h" //////////////////////////////////////////////////////////////////// -// Class : qpLensNode +// Class : LensNode // Description : A node that contains a Lens. The most important // example of this kind of node is a Camera, but other // kinds of nodes also contain a lens (for instance, a // Spotlight). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpLensNode : public PandaNode { +class EXPCL_PANDA LensNode : public PandaNode { PUBLISHED: - qpLensNode(const string &name); + LensNode(const string &name); protected: - qpLensNode(const qpLensNode ©); + LensNode(const LensNode ©); public: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; @@ -71,7 +71,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpLensNode", + register_type(_type_handle, "LensNode", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -83,6 +83,6 @@ private: static TypeHandle _type_handle; }; -#include "qplensNode.I" +#include "lensNode.I" #endif diff --git a/panda/src/pgraph/light.cxx b/panda/src/pgraph/light.cxx index 65d40d77c4..5bdb6b5e2d 100644 --- a/panda/src/pgraph/light.cxx +++ b/panda/src/pgraph/light.cxx @@ -74,13 +74,13 @@ Light:: // the Light. This is used during the cull traversal to // render the Lights that have been made visible. //////////////////////////////////////////////////////////////////// -qpGeomNode *Light:: +GeomNode *Light:: get_viz() { CDReader cdata(_cycler); if (cdata->_viz_geom_stale) { CDWriter cdata_w(_cycler, cdata); - cdata_w->_viz_geom = new qpGeomNode("viz"); + cdata_w->_viz_geom = new GeomNode("viz"); fill_viz_geom(cdata_w->_viz_geom); cdata_w->_viz_geom_stale = false; } @@ -94,7 +94,7 @@ get_viz() { // for rendering this light. //////////////////////////////////////////////////////////////////// void Light:: -fill_viz_geom(qpGeomNode *) { +fill_viz_geom(GeomNode *) { } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/light.h b/panda/src/pgraph/light.h index 38090839f7..693c3afb8e 100644 --- a/panda/src/pgraph/light.h +++ b/panda/src/pgraph/light.h @@ -27,7 +27,7 @@ #include "cycleDataReader.h" #include "cycleDataWriter.h" #include "pipelineCycler.h" -#include "qpgeomNode.h" +#include "geomNode.h" class PandaNode; class GraphicsStateGuardianBase; @@ -60,10 +60,10 @@ public: virtual void write(ostream &out, int indent_level) const=0; virtual void bind(GraphicsStateGuardianBase *gsg, int light_id)=0; - qpGeomNode *get_viz(); + GeomNode *get_viz(); protected: - virtual void fill_viz_geom(qpGeomNode *viz_geom); + virtual void fill_viz_geom(GeomNode *viz_geom); INLINE void mark_viz_stale(); private: @@ -78,7 +78,7 @@ private: Colorf _color; - PT(qpGeomNode) _viz_geom; + PT(GeomNode) _viz_geom; bool _viz_geom_stale; }; diff --git a/panda/src/pgraph/lightLensNode.cxx b/panda/src/pgraph/lightLensNode.cxx index 7c29c1969d..37bcd64b08 100644 --- a/panda/src/pgraph/lightLensNode.cxx +++ b/panda/src/pgraph/lightLensNode.cxx @@ -31,7 +31,7 @@ TypeHandle LightLensNode::_type_handle; //////////////////////////////////////////////////////////////////// LightLensNode:: LightLensNode(const string &name) : - qpLensNode(name) + LensNode(name) { } @@ -43,7 +43,7 @@ LightLensNode(const string &name) : LightLensNode:: LightLensNode(const LightLensNode ©) : Light(copy), - qpLensNode(copy) + LensNode(copy) { } @@ -76,7 +76,7 @@ as_light() { //////////////////////////////////////////////////////////////////// void LightLensNode:: output(ostream &out) const { - qpLensNode::output(out); + LensNode::output(out); } //////////////////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ output(ostream &out) const { //////////////////////////////////////////////////////////////////// void LightLensNode:: write(ostream &out, int indent_level) const { - qpLensNode::write(out, indent_level); + LensNode::write(out, indent_level); } //////////////////////////////////////////////////////////////////// @@ -97,7 +97,7 @@ write(ostream &out, int indent_level) const { //////////////////////////////////////////////////////////////////// void LightLensNode:: write_datagram(BamWriter *manager, Datagram &dg) { - qpLensNode::write_datagram(manager, dg); + LensNode::write_datagram(manager, dg); Light::write_datagram(manager, dg); } @@ -110,6 +110,6 @@ write_datagram(BamWriter *manager, Datagram &dg) { //////////////////////////////////////////////////////////////////// void LightLensNode:: fillin(DatagramIterator &scan, BamReader *manager) { - qpLensNode::fillin(scan, manager); + LensNode::fillin(scan, manager); Light::fillin(scan, manager); } diff --git a/panda/src/pgraph/lightLensNode.h b/panda/src/pgraph/lightLensNode.h index dffc01cd5e..12741105d8 100644 --- a/panda/src/pgraph/lightLensNode.h +++ b/panda/src/pgraph/lightLensNode.h @@ -22,13 +22,13 @@ #include "pandabase.h" #include "light.h" -#include "qplensNode.h" +#include "lensNode.h" //////////////////////////////////////////////////////////////////// // Class : LightLensNode // Description : A derivative of Light and of LensNode. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA LightLensNode : public Light, public qpLensNode { +class EXPCL_PANDA LightLensNode : public Light, public LensNode { PUBLISHED: LightLensNode(const string &name); @@ -57,10 +57,10 @@ public: } static void init_type() { Light::init_type(); - qpLensNode::init_type(); + LensNode::init_type(); register_type(_type_handle, "LightLensNode", Light::get_class_type(), - qpLensNode::get_class_type()); + LensNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgraph/qplodNode.I b/panda/src/pgraph/lodNode.I similarity index 81% rename from panda/src/pgraph/qplodNode.I rename to panda/src/pgraph/lodNode.I index 37ccefae84..500ddfa2f5 100644 --- a/panda/src/pgraph/qplodNode.I +++ b/panda/src/pgraph/lodNode.I @@ -1,4 +1,4 @@ -// Filename: qplodNode.I +// Filename: lodNode.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,52 +17,52 @@ //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::CData::Constructor +// Function: LODNode::CData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLODNode::CData:: +INLINE LODNode::CData:: CData() { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::CData::Copy Constructor +// Function: LODNode::CData::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLODNode::CData:: -CData(const qpLODNode::CData ©) : +INLINE LODNode::CData:: +CData(const LODNode::CData ©) : _lod(copy._lod) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::Constructor +// Function: LODNode::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLODNode:: -qpLODNode(const string &name) : +INLINE LODNode:: +LODNode(const string &name) : SelectiveChildNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::Copy Constructor +// Function: LODNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -INLINE qpLODNode:: -qpLODNode(const qpLODNode ©) : +INLINE LODNode:: +LODNode(const LODNode ©) : SelectiveChildNode(copy), _cycler(copy._cycler) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::add_switch +// Function: LODNode::add_switch // Access: Published -// Description: Adds a switch range to the qpLODNode. This implies +// Description: Adds a switch range to the LODNode. This implies // that the corresponding child node has been parented // to the node. // @@ -72,19 +72,19 @@ qpLODNode(const qpLODNode ©) : // close distance. Thus, "in" should be larger than // "out". //////////////////////////////////////////////////////////////////// -INLINE void qpLODNode:: +INLINE void LODNode:: add_switch(float in, float out) { CDWriter cdata(_cycler); cdata->_lod._switch_vector.push_back(LODSwitch(in, out)); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::set_switch +// Function: LODNode::set_switch // Access: Published // Description: Changes the switching range of a particular child of -// the qpLODNode. See add_switch(). +// the LODNode. See add_switch(). //////////////////////////////////////////////////////////////////// -INLINE bool qpLODNode:: +INLINE bool LODNode:: set_switch(int index, float in, float out) { CDWriter cdata(_cycler); nassertr(index >= 0 && index < (int)cdata->_lod._switch_vector.size(), false); @@ -93,13 +93,13 @@ set_switch(int index, float in, float out) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::clear_switches +// Function: LODNode::clear_switches // Access: Published -// Description: Removes the set of switching ranges for the qpLODNode, +// Description: Removes the set of switching ranges for the LODNode, // presumably in conjunction with removing all of its // children. See add_switch(). //////////////////////////////////////////////////////////////////// -INLINE void qpLODNode:: +INLINE void LODNode:: clear_switches(void) { CDWriter cdata(_cycler); cdata->_lod._switch_vector.erase(cdata->_lod._switch_vector.begin(), @@ -107,27 +107,27 @@ clear_switches(void) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::get_num_switches +// Function: LODNode::get_num_switches // Access: Published // Description: Returns the number of switch ranges added to the -// qpLODNode. This should correspond to the number of -// children of the node in order for the qpLODNode to +// LODNode. This should correspond to the number of +// children of the node in order for the LODNode to // function correctly. //////////////////////////////////////////////////////////////////// -INLINE int qpLODNode:: +INLINE int LODNode:: get_num_switches() const { CDReader cdata(_cycler); return cdata->_lod._switch_vector.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::get_in +// Function: LODNode::get_in // Access: Published // Description: Returns the "in" distance of the indicated switch // range. This should be larger than the "out" distance // of the same range. //////////////////////////////////////////////////////////////////// -INLINE float qpLODNode:: +INLINE float LODNode:: get_in(int index) const { CDReader cdata(_cycler); nassertr(index >= 0 && index < (int)cdata->_lod._switch_vector.size(), 0.0); @@ -135,13 +135,13 @@ get_in(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::get_out +// Function: LODNode::get_out // Access: Published // Description: Returns the "out" distance of the indicated switch // range. This should be smaller than the "in" distance // of the same range. //////////////////////////////////////////////////////////////////// -INLINE float qpLODNode:: +INLINE float LODNode:: get_out(int index) const { CDReader cdata(_cycler); nassertr(index >= 0 && index < (int)cdata->_lod._switch_vector.size(), 0.0); @@ -149,26 +149,26 @@ get_out(int index) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::set_center +// Function: LODNode::set_center // Access: Published // Description: Specifies the center of the LOD. This is the point // that is compared to the camera (in camera space) to // determine the particular LOD that should be chosen. //////////////////////////////////////////////////////////////////// -INLINE void qpLODNode:: +INLINE void LODNode:: set_center(const LPoint3f ¢er) { CDWriter cdata(_cycler); cdata->_lod._center = center; } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::get_center +// Function: LODNode::get_center // Access: Published // Description: Returns the center of the LOD. This is the point // that is compared to the camera (in camera space) to // determine the particular LOD that should be chosen. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpLODNode:: +INLINE const LPoint3f &LODNode:: get_center() const { CDReader cdata(_cycler); return cdata->_lod._center; diff --git a/panda/src/pgraph/qplodNode.cxx b/panda/src/pgraph/lodNode.cxx similarity index 84% rename from panda/src/pgraph/qplodNode.cxx rename to panda/src/pgraph/lodNode.cxx index e4b22dc64d..4d50cca87c 100644 --- a/panda/src/pgraph/qplodNode.cxx +++ b/panda/src/pgraph/lodNode.cxx @@ -1,4 +1,4 @@ -// Filename: qplodNode.cxx +// Filename: lodNode.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,60 +16,60 @@ // //////////////////////////////////////////////////////////////////// -#include "qplodNode.h" +#include "lodNode.h" #include "cullTraverserData.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" -TypeHandle qpLODNode::_type_handle; +TypeHandle LODNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::CData::make_copy +// Function: LODNode::CData::make_copy // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -CycleData *qpLODNode::CData:: +CycleData *LODNode::CData:: make_copy() const { return new CData(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::CData::write_datagram +// Function: LODNode::CData::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpLODNode::CData:: +void LODNode::CData:: write_datagram(BamWriter *manager, Datagram &dg) const { _lod.write_datagram(dg); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::CData::fillin +// Function: LODNode::CData::fillin // Access: Public, Virtual // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpLODNode. +// the new LODNode. //////////////////////////////////////////////////////////////////// -void qpLODNode::CData:: +void LODNode::CData:: fillin(DatagramIterator &scan, BamReader *manager) { _lod.read_datagram(scan); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::make_copy +// Function: LODNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpLODNode:: +PandaNode *LODNode:: make_copy() const { - return new qpLODNode(*this); + return new LODNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::safe_to_combine +// Function: LODNode::safe_to_combine // Access: Public, Virtual // Description: Returns true if it is generally safe to combine this // particular kind of PandaNode with other kinds of @@ -78,26 +78,26 @@ make_copy() const { // other PandaNode, because its set of children is // meaningful. //////////////////////////////////////////////////////////////////// -bool qpLODNode:: +bool LODNode:: safe_to_combine() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::xform +// Function: LODNode::xform // Access: Public, Virtual // Description: Transforms the contents of this PandaNode by the // indicated matrix, if it means anything to do so. For // most kinds of PandaNodes, this does nothing. //////////////////////////////////////////////////////////////////// -void qpLODNode:: +void LODNode:: xform(const LMatrix4f &mat) { CDWriter cdata(_cycler); cdata->_lod.xform(mat); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::has_cull_callback +// Function: LODNode::has_cull_callback // Access: Public, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -105,13 +105,13 @@ xform(const LMatrix4f &mat) { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpLODNode:: +bool LODNode:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::cull_callback +// Function: LODNode::cull_callback // Access: Public, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -129,8 +129,8 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpLODNode:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { +bool LODNode:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { if (data._net_transform->is_singular()) { // If we're under a singular transform, we can't compute the LOD; // select none of them instead. @@ -154,11 +154,11 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::output +// Function: LODNode::output // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpLODNode:: +void LODNode:: output(ostream &out) const { SelectiveChildNode::output(out); CDReader cdata(_cycler); @@ -167,39 +167,39 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::register_with_read_factory +// Function: LODNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpLODNode. +// LODNode. //////////////////////////////////////////////////////////////////// -void qpLODNode:: +void LODNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::write_datagram +// Function: LODNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpLODNode:: +void LODNode:: write_datagram(BamWriter *manager, Datagram &dg) { SelectiveChildNode::write_datagram(manager, dg); manager->write_cdata(dg, _cycler); } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::make_from_bam +// Function: LODNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpLODNode is encountered -// in the Bam file. It should create the qpLODNode +// when a new object of type LODNode is encountered +// in the Bam file. It should create the LODNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpLODNode:: +TypedWritable *LODNode:: make_from_bam(const FactoryParams ¶ms) { - qpLODNode *node = new qpLODNode(""); + LODNode *node = new LODNode(""); DatagramIterator scan; BamReader *manager; @@ -210,13 +210,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpLODNode::fillin +// Function: LODNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpLODNode. +// the new LODNode. //////////////////////////////////////////////////////////////////// -void qpLODNode:: +void LODNode:: fillin(DatagramIterator &scan, BamReader *manager) { SelectiveChildNode::fillin(scan, manager); manager->read_cdata(scan, _cycler); diff --git a/panda/src/pgraph/qplodNode.h b/panda/src/pgraph/lodNode.h similarity index 88% rename from panda/src/pgraph/qplodNode.h rename to panda/src/pgraph/lodNode.h index 11adde9562..ac83bdb46d 100644 --- a/panda/src/pgraph/qplodNode.h +++ b/panda/src/pgraph/lodNode.h @@ -1,4 +1,4 @@ -// Filename: qplodNode.h +// Filename: lodNode.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpLODNODE_H -#define qpLODNODE_H +#ifndef LODNODE_H +#define LODNODE_H #include "pandabase.h" @@ -26,24 +26,24 @@ #include "LOD.h" //////////////////////////////////////////////////////////////////// -// Class : qpLODNode +// Class : LODNode // Description : A Level-of-Detail node. This selects only one of its // children for rendering, according to the distance // from the camera and the table indicated in the // associated LOD object. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpLODNode : public SelectiveChildNode { +class EXPCL_PANDA LODNode : public SelectiveChildNode { PUBLISHED: - INLINE qpLODNode(const string &name); + INLINE LODNode(const string &name); protected: - INLINE qpLODNode(const qpLODNode ©); + INLINE LODNode(const LODNode ©); public: virtual PandaNode *make_copy() const; virtual bool safe_to_combine() const; virtual void xform(const LMatrix4f &mat); virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual void output(ostream &out) const; @@ -94,7 +94,7 @@ public: } static void init_type() { SelectiveChildNode::init_type(); - register_type(_type_handle, "qpLODNode", + register_type(_type_handle, "LODNode", SelectiveChildNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -106,6 +106,6 @@ private: static TypeHandle _type_handle; }; -#include "qplodNode.I" +#include "lodNode.I" #endif diff --git a/panda/src/pgraph/qpmodelNode.I b/panda/src/pgraph/modelNode.I similarity index 83% rename from panda/src/pgraph/qpmodelNode.I rename to panda/src/pgraph/modelNode.I index 557904fe71..523fae891c 100644 --- a/panda/src/pgraph/qpmodelNode.I +++ b/panda/src/pgraph/modelNode.I @@ -1,4 +1,4 @@ -// Filename: qpmodelNode.I +// Filename: modelNode.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,19 +18,19 @@ //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::Constructor +// Function: ModelNode::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpModelNode:: -qpModelNode(const string &name) : +INLINE ModelNode:: +ModelNode(const string &name) : PandaNode(name) { _preserve_transform = false; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::set_preserve_transform +// Function: ModelNode::set_preserve_transform // Access: Public // Description: Sets the preserve_transform flag. When this flag is // true, flattening the scene graph will not flatten out @@ -38,29 +38,29 @@ qpModelNode(const string &name) : // otherwise, any transforms applying to this node may // or may not be flattened. //////////////////////////////////////////////////////////////////// -INLINE void qpModelNode:: +INLINE void ModelNode:: set_preserve_transform(bool preserve_transform) { _preserve_transform = preserve_transform; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::get_preserve_transform +// Function: ModelNode::get_preserve_transform // Access: Public // Description: Returns the current setting of the preserve_transform // flag. See set_preserve_transform(). //////////////////////////////////////////////////////////////////// -INLINE bool qpModelNode:: +INLINE bool ModelNode:: get_preserve_transform() const { return _preserve_transform; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::Copy Constructor +// Function: ModelNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -INLINE qpModelNode:: -qpModelNode(const qpModelNode ©) : +INLINE ModelNode:: +ModelNode(const ModelNode ©) : PandaNode(copy), _preserve_transform(copy._preserve_transform) { diff --git a/panda/src/pgraph/qpmodelNode.cxx b/panda/src/pgraph/modelNode.cxx similarity index 80% rename from panda/src/pgraph/qpmodelNode.cxx rename to panda/src/pgraph/modelNode.cxx index 0c4014315f..812ee78426 100644 --- a/panda/src/pgraph/qpmodelNode.cxx +++ b/panda/src/pgraph/modelNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpmodelNode.cxx +// Filename: modelNode.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,30 +16,30 @@ // //////////////////////////////////////////////////////////////////// -#include "qpmodelNode.h" +#include "modelNode.h" #include "bamReader.h" #include "datagram.h" #include "datagramIterator.h" -TypeHandle qpModelNode::_type_handle; +TypeHandle ModelNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::make_copy +// Function: ModelNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpModelNode:: +PandaNode *ModelNode:: make_copy() const { - return new qpModelNode(*this); + return new ModelNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::safe_to_flatten +// Function: ModelNode::safe_to_flatten // Access: Public, Virtual // Description: Returns true if it is generally safe to flatten out // this particular kind of Node by duplicating @@ -47,26 +47,26 @@ make_copy() const { // cannot be safely flattened, because the Camera // pointer itself is meaningful). //////////////////////////////////////////////////////////////////// -bool qpModelNode:: +bool ModelNode:: safe_to_flatten() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::safe_to_transform +// Function: ModelNode::safe_to_transform // Access: Public, Virtual // Description: Returns true if it is generally safe to transform // this particular kind of Node by calling the xform() // method, false otherwise. For instance, it's usually // a bad idea to attempt to xform a Character. //////////////////////////////////////////////////////////////////// -bool qpModelNode:: +bool ModelNode:: safe_to_transform() const { return !_preserve_transform; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::safe_to_combine +// Function: ModelNode::safe_to_combine // Access: Public, Virtual // Description: Returns true if it is generally safe to combine this // particular kind of PandaNode with other kinds of @@ -75,57 +75,57 @@ safe_to_transform() const { // other PandaNode, because its set of children is // meaningful. //////////////////////////////////////////////////////////////////// -bool qpModelNode:: +bool ModelNode:: safe_to_combine() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::preserve_name +// Function: ModelNode::preserve_name // Access: Public, Virtual // Description: Returns true if the node's name has extrinsic meaning // and must be preserved across a flatten operation, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpModelNode:: +bool ModelNode:: preserve_name() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::register_with_read_factory +// Function: ModelNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpModelNode. +// ModelNode. //////////////////////////////////////////////////////////////////// -void qpModelNode:: +void ModelNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::write_datagram +// Function: ModelNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpModelNode:: +void ModelNode:: write_datagram(BamWriter *manager, Datagram &dg) { PandaNode::write_datagram(manager, dg); dg.add_bool(_preserve_transform); } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::make_from_bam +// Function: ModelNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpModelNode is encountered -// in the Bam file. It should create the qpModelNode +// when a new object of type ModelNode is encountered +// in the Bam file. It should create the ModelNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpModelNode:: +TypedWritable *ModelNode:: make_from_bam(const FactoryParams ¶ms) { - qpModelNode *node = new qpModelNode(""); + ModelNode *node = new ModelNode(""); DatagramIterator scan; BamReader *manager; @@ -136,20 +136,15 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelNode::fillin +// Function: ModelNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpModelNode. +// the new ModelNode. //////////////////////////////////////////////////////////////////// -void qpModelNode:: +void ModelNode:: fillin(DatagramIterator &scan, BamReader *manager) { PandaNode::fillin(scan, manager); - if (manager->get_file_minor_ver() < 2) { - // No _preserve_transform before bams 3.2. - _preserve_transform = false; - } else { - _preserve_transform = scan.get_bool(); - } + _preserve_transform = scan.get_bool(); } diff --git a/panda/src/pgraph/qpmodelNode.h b/panda/src/pgraph/modelNode.h similarity index 85% rename from panda/src/pgraph/qpmodelNode.h rename to panda/src/pgraph/modelNode.h index de54428102..d5a8d5e55f 100644 --- a/panda/src/pgraph/qpmodelNode.h +++ b/panda/src/pgraph/modelNode.h @@ -1,4 +1,4 @@ -// Filename: qpmodelNode.h +// Filename: modelNode.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,15 +16,15 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpMODELNODE_H -#define qpMODELNODE_H +#ifndef MODELNODE_H +#define MODELNODE_H #include "pandabase.h" #include "pandaNode.h" //////////////////////////////////////////////////////////////////// -// Class : qpModelNode +// Class : ModelNode // Description : This node is placed at key points within the scene // graph to indicate the roots of "models": subtrees // that are conceptually to be treated as a single unit, @@ -32,15 +32,15 @@ // affect rendering or any other operations; it's // primarily useful as a high-level model indication. // -// qpModelNodes are created in response to a { 1 } +// ModelNodes are created in response to a { 1 } // flag within an egg file. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpModelNode : public PandaNode { +class EXPCL_PANDA ModelNode : public PandaNode { PUBLISHED: - INLINE qpModelNode(const string &name); + INLINE ModelNode(const string &name); protected: - INLINE qpModelNode(const qpModelNode ©); + INLINE ModelNode(const ModelNode ©); public: virtual PandaNode *make_copy() const; @@ -71,7 +71,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpModelNode", + register_type(_type_handle, "ModelNode", PandaNode::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -83,7 +83,7 @@ private: static TypeHandle _type_handle; }; -#include "qpmodelNode.I" +#include "modelNode.I" #endif diff --git a/panda/src/pgraph/qpmodelRoot.I b/panda/src/pgraph/modelRoot.I similarity index 78% rename from panda/src/pgraph/qpmodelRoot.I rename to panda/src/pgraph/modelRoot.I index ae570c05e6..782768c12f 100644 --- a/panda/src/pgraph/qpmodelRoot.I +++ b/panda/src/pgraph/modelRoot.I @@ -1,4 +1,4 @@ -// Filename: qpmodelRoot.I +// Filename: modelRoot.I // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,23 +17,23 @@ //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::Constructor +// Function: ModelRoot::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpModelRoot:: -qpModelRoot(const string &name) : - qpModelNode(name) +INLINE ModelRoot:: +ModelRoot(const string &name) : + ModelNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::Copy Constructor +// Function: ModelRoot::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpModelRoot:: -qpModelRoot(const qpModelRoot ©) : - qpModelNode(copy) +INLINE ModelRoot:: +ModelRoot(const ModelRoot ©) : + ModelNode(copy) { } diff --git a/panda/src/pgraph/qpmodelRoot.cxx b/panda/src/pgraph/modelRoot.cxx similarity index 76% rename from panda/src/pgraph/qpmodelRoot.cxx rename to panda/src/pgraph/modelRoot.cxx index c2dec56eb7..85236b0a9f 100644 --- a/panda/src/pgraph/qpmodelRoot.cxx +++ b/panda/src/pgraph/modelRoot.cxx @@ -1,4 +1,4 @@ -// Filename: qpmodelRoot.cxx +// Filename: modelRoot.cxx // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,57 +16,57 @@ // //////////////////////////////////////////////////////////////////// -#include "qpmodelRoot.h" +#include "modelRoot.h" -TypeHandle qpModelRoot::_type_handle; +TypeHandle ModelRoot::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::make_copy +// Function: ModelRoot::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpModelRoot:: +PandaNode *ModelRoot:: make_copy() const { - return new qpModelRoot(*this); + return new ModelRoot(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::register_with_read_factory +// Function: ModelRoot::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpModelRoot. +// ModelRoot. //////////////////////////////////////////////////////////////////// -void qpModelRoot:: +void ModelRoot:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::write_datagram +// Function: ModelRoot::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpModelRoot:: +void ModelRoot:: write_datagram(BamWriter *manager, Datagram &dg) { - qpModelNode::write_datagram(manager, dg); + ModelNode::write_datagram(manager, dg); } //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::make_from_bam +// Function: ModelRoot::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpModelRoot is encountered -// in the Bam file. It should create the qpModelRoot +// when a new object of type ModelRoot is encountered +// in the Bam file. It should create the ModelRoot // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpModelRoot:: +TypedWritable *ModelRoot:: make_from_bam(const FactoryParams ¶ms) { - qpModelRoot *node = new qpModelRoot(""); + ModelRoot *node = new ModelRoot(""); DatagramIterator scan; BamReader *manager; @@ -77,13 +77,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpModelRoot::fillin +// Function: ModelRoot::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpModelRoot. +// the new ModelRoot. //////////////////////////////////////////////////////////////////// -void qpModelRoot:: +void ModelRoot:: fillin(DatagramIterator &scan, BamReader *manager) { - qpModelNode::fillin(scan, manager); + ModelNode::fillin(scan, manager); } diff --git a/panda/src/pgraph/qpmodelRoot.h b/panda/src/pgraph/modelRoot.h similarity index 81% rename from panda/src/pgraph/qpmodelRoot.h rename to panda/src/pgraph/modelRoot.h index a01181deee..bc26600a37 100644 --- a/panda/src/pgraph/qpmodelRoot.h +++ b/panda/src/pgraph/modelRoot.h @@ -1,4 +1,4 @@ -// Filename: qpmodelRoot.h +// Filename: modelRoot.h // Created by: drose (16Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,15 +16,15 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpMODELROOT_H -#define qpMODELROOT_H +#ifndef MODELROOT_H +#define MODELROOT_H #include "pandabase.h" -#include "qpmodelNode.h" +#include "modelNode.h" //////////////////////////////////////////////////////////////////// -// Class : qpModelRoot +// Class : ModelRoot // Description : A node of this type is created automatically at the // root of each model file that is loaded. It may // eventually contain some information about the @@ -32,12 +32,12 @@ // special information, but can be used as a flag to // indicate the presence of a loaded model file. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpModelRoot : public qpModelNode { +class EXPCL_PANDA ModelRoot : public ModelNode { PUBLISHED: - INLINE qpModelRoot(const string &name ); + INLINE ModelRoot(const string &name ); protected: - INLINE qpModelRoot(const qpModelRoot ©); + INLINE ModelRoot(const ModelRoot ©); public: virtual PandaNode *make_copy() const; @@ -55,9 +55,9 @@ public: return _type_handle; } static void init_type() { - qpModelNode::init_type(); - register_type(_type_handle, "qpModelRoot", - qpModelNode::get_class_type()); + ModelNode::init_type(); + register_type(_type_handle, "ModelRoot", + ModelNode::get_class_type()); } virtual TypeHandle get_type(void) const { return get_class_type(); @@ -68,7 +68,7 @@ private: static TypeHandle _type_handle; }; -#include "qpmodelRoot.I" +#include "modelRoot.I" #endif diff --git a/panda/src/pgraph/qpnodePath.I b/panda/src/pgraph/nodePath.I similarity index 78% rename from panda/src/pgraph/qpnodePath.I rename to panda/src/pgraph/nodePath.I index d3ad29df93..435bcef633 100644 --- a/panda/src/pgraph/qpnodePath.I +++ b/panda/src/pgraph/nodePath.I @@ -1,4 +1,4 @@ -// Filename: qpnodePath.I +// Filename: nodePath.I // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,25 +18,25 @@ //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Default Constructor +// Function: NodePath::Default Constructor // Access: Published -// Description: This constructs an empty qpNodePath with no nodes. +// Description: This constructs an empty NodePath with no nodes. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath:: -qpNodePath() : +INLINE NodePath:: +NodePath() : _error_type(ET_ok) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Constructor +// Function: NodePath::Constructor // Access: Published -// Description: This constructs a new qpNodePath with a single +// Description: This constructs a new NodePath with a single // node. An ordinary, unattached PandaNode is created // with the indicated name. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath:: -qpNodePath(const string &top_node_name) : +INLINE NodePath:: +NodePath(const string &top_node_name) : _error_type(ET_ok) { PandaNode *top_node = new PandaNode(top_node_name); @@ -44,7 +44,7 @@ qpNodePath(const string &top_node_name) : } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Constructor +// Function: NodePath::Constructor // Access: Published // Description: This constructs a NodePath for the indicated node. // If the node does not have any parents, this creates a @@ -54,8 +54,8 @@ qpNodePath(const string &top_node_name) : // arbitrarily and a warning message is printed (but see // also NodePath::any_path(), below). //////////////////////////////////////////////////////////////////// -INLINE qpNodePath:: -qpNodePath(PandaNode *node) : +INLINE NodePath:: +NodePath(PandaNode *node) : _error_type(ET_ok) { if (node != (PandaNode *)NULL) { @@ -64,7 +64,7 @@ qpNodePath(PandaNode *node) : } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::any_path named constructor +// Function: NodePath::any_path named constructor // Access: Published, Static // Description: Returns a new NodePath that represents any arbitrary // path from the root to the indicated node. This is @@ -72,9 +72,9 @@ qpNodePath(PandaNode *node) : // NodePath(node), except that no warning is issued if // the path is ambiguous. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: any_path(PandaNode *node) { - qpNodePath result; + NodePath result; if (node != (PandaNode *)NULL) { result._head = node->get_generic_component(true); } @@ -82,33 +82,33 @@ any_path(PandaNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Constructor +// Function: NodePath::Constructor // Access: Published // Description: Constructs a NodePath with the indicated parent // NodePath and child node; the child node must be a // stashed or unstashed child of the parent. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath:: -qpNodePath(const qpNodePath &parent, PandaNode *child_node) : +INLINE NodePath:: +NodePath(const NodePath &parent, PandaNode *child_node) : _error_type(ET_fail) { nassertv(!parent.is_empty()); nassertv(child_node != (PandaNode *)NULL); _head = PandaNode::get_component(parent._head, child_node); - nassertv(_head != (qpNodePathComponent *)NULL); + nassertv(_head != (NodePathComponent *)NULL); - if (_head != (qpNodePathComponent *)NULL) { + if (_head != (NodePathComponent *)NULL) { _error_type = ET_ok; } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Copy Constructor +// Function: NodePath::Copy Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpNodePath:: -qpNodePath(const qpNodePath ©) : +INLINE NodePath:: +NodePath(const NodePath ©) : _head(copy._head), _error_type(copy._error_type) { @@ -116,58 +116,58 @@ qpNodePath(const qpNodePath ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::Copy Assignment Operator +// Function: NodePath::Copy Assignment Operator // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -operator = (const qpNodePath ©) { +INLINE void NodePath:: +operator = (const NodePath ©) { _head = copy._head; _error_type = copy._error_type; uncollapse_head(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::not_found named constructor +// Function: NodePath::not_found named constructor // Access: Published, Static -// Description: Creates a qpNodePath with the ET_not_found error type +// Description: Creates a NodePath with the ET_not_found error type // set. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: not_found() { - qpNodePath result; + NodePath result; result._error_type = ET_not_found; return result; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::removed named constructor +// Function: NodePath::removed named constructor // Access: Published, Static -// Description: Creates a qpNodePath with the ET_removed error type +// Description: Creates a NodePath with the ET_removed error type // set. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: removed() { - qpNodePath result; + NodePath result; result._error_type = ET_removed; return result; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::fail named constructor +// Function: NodePath::fail named constructor // Access: Published, Static -// Description: Creates a qpNodePath with the ET_fail error type +// Description: Creates a NodePath with the ET_fail error type // set. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: fail() { - qpNodePath result; + NodePath result; result._error_type = ET_fail; return result; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_max_search_depth +// Function: NodePath::set_max_search_depth // Access: Published, Static // Description: Certain operations, such as find() or // find_all_matches(), require a traversal of the scene @@ -189,69 +189,69 @@ fail() { // parameter affects all of the NodePaths in the // universe. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_max_search_depth(int max_search_depth) { _max_search_depth = max_search_depth; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_max_search_depth +// Function: NodePath::get_max_search_depth // Access: Published, Static // Description: Returns the current setting of the search depth // limit. See set_max_search_depth. //////////////////////////////////////////////////////////////////// -INLINE int qpNodePath:: +INLINE int NodePath:: get_max_search_depth() { return _max_search_depth; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::is_empty +// Function: NodePath::is_empty // Access: Published -// Description: Returns true if the qpNodePath contains no nodes. +// Description: Returns true if the NodePath contains no nodes. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: is_empty() const { uncollapse_head(); - return (_head == (qpNodePathComponent *)NULL); + return (_head == (NodePathComponent *)NULL); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::is_singleton +// Function: NodePath::is_singleton // Access: Published -// Description: Returns true if the qpNodePath contains exactly one +// Description: Returns true if the NodePath contains exactly one // node. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: is_singleton() const { uncollapse_head(); - return (_head != (qpNodePathComponent *)NULL && _head->is_top_node()); + return (_head != (NodePathComponent *)NULL && _head->is_top_node()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_error_type +// Function: NodePath::get_error_type // Access: Published // Description: If is_empty() is true, this returns a code that -// represents the reason why the qpNodePath is empty. +// represents the reason why the NodePath is empty. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath::ErrorType qpNodePath:: +INLINE NodePath::ErrorType NodePath:: get_error_type() const { return _error_type; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::node +// Function: NodePath::node // Access: Published // Description: Returns the referenced node of the path. //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpNodePath:: +INLINE PandaNode *NodePath:: node() const { nassertr_always(!is_empty(), (PandaNode *)NULL); return _head->get_node(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_key +// Function: NodePath::get_key // Access: Published // Description: Returns an integer that is guaranteed to be the same // for all NodePaths that represent the same node @@ -274,7 +274,7 @@ node() const { // operation (for instance, detaching a node below an // instanced node). //////////////////////////////////////////////////////////////////// -INLINE int qpNodePath:: +INLINE int NodePath:: get_key() const { if (is_empty()) { return 0; @@ -283,86 +283,86 @@ get_key() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_num_children +// Function: NodePath::get_num_children // Access: Published // Description: Returns the number of children of the referenced node. //////////////////////////////////////////////////////////////////// -INLINE int qpNodePath:: +INLINE int NodePath:: get_num_children() const { nassertr_always(!is_empty(), 0); return _head->get_node()->get_num_children(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_child +// Function: NodePath::get_child // Access: Published -// Description: Returns a qpNodePath representing the nth child of the +// Description: Returns a NodePath representing the nth child of the // referenced node. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: get_child(int n) const { - nassertr(n >= 0 && n < get_num_children(), qpNodePath()); - qpNodePath child; + nassertr(n >= 0 && n < get_num_children(), NodePath()); + NodePath child; child._head = PandaNode::get_component(_head, _head->get_node()->get_child(n)); return child; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_parent +// Function: NodePath::has_parent // Access: Published // Description: Returns true if the referenced node has a parent; // i.e. the NodePath chain contains at least two nodes. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: has_parent() const { return !is_empty() && !is_singleton(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_parent +// Function: NodePath::get_parent // Access: Published -// Description: Returns the qpNodePath to the parent of the referenced -// node: that is, this qpNodePath, shortened by one node. +// Description: Returns the NodePath to the parent of the referenced +// node: that is, this NodePath, shortened by one node. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: get_parent() const { - nassertr(has_parent(), qpNodePath::fail()); - qpNodePath parent; + nassertr(has_parent(), NodePath::fail()); + NodePath parent; parent._head = _head->get_next(); return parent; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::attach_new_node +// Function: NodePath::attach_new_node // Access: Published // Description: Creates an ordinary PandaNode and attaches it below -// the current qpNodePath, returning a new qpNodePath that +// the current NodePath, returning a new NodePath that // references it. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath qpNodePath:: +INLINE NodePath NodePath:: attach_new_node(const string &name, int sort) const { - nassertr(verify_complete(), qpNodePath::fail()); + nassertr(verify_complete(), NodePath::fail()); nassertr_always(!is_empty(), *this); return attach_new_node(new PandaNode(name), sort); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::ls +// Function: NodePath::ls // Access: Published // Description: Lists the hierarchy at and below the referenced node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: ls() const { ls(nout); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::ls +// Function: NodePath::ls // Access: Published // Description: Lists the hierarchy at and below the referenced node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: ls(ostream &out, int indent_level) const { if (is_empty()) { out << "(empty)\n"; @@ -372,183 +372,183 @@ ls(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_state +// Function: NodePath::get_state // Access: Published // Description: Returns the complete state object set on this node. //////////////////////////////////////////////////////////////////// -INLINE const RenderState *qpNodePath:: +INLINE const RenderState *NodePath:: get_state() const { nassertr_always(!is_empty(), RenderState::make_empty()); return node()->get_state(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_state +// Function: NodePath::set_state // Access: Published // Description: Changes the complete state object on this node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_state(const RenderState *state) const { nassertv_always(!is_empty()); node()->set_state(state); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_net_state +// Function: NodePath::get_net_state // Access: Published // Description: Returns the net state on this node from the root. //////////////////////////////////////////////////////////////////// -INLINE CPT(RenderState) qpNodePath:: +INLINE CPT(RenderState) NodePath:: get_net_state() const { uncollapse_head(); return r_get_net_state(_head); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_transform +// Function: NodePath::get_transform // Access: Published // Description: Returns the complete transform object set on this node. //////////////////////////////////////////////////////////////////// -INLINE const TransformState *qpNodePath:: +INLINE const TransformState *NodePath:: get_transform() const { nassertr_always(!is_empty(), TransformState::make_identity()); return node()->get_transform(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_transform +// Function: NodePath::set_transform // Access: Published // Description: Changes the complete transform object on this node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_transform(const TransformState *transform) const { nassertv_always(!is_empty()); node()->set_transform(transform); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_net_transform +// Function: NodePath::get_net_transform // Access: Published // Description: Returns the net transform on this node from the root. //////////////////////////////////////////////////////////////////// -INLINE CPT(TransformState) qpNodePath:: +INLINE CPT(TransformState) NodePath:: get_net_transform() const { uncollapse_head(); return r_get_net_transform(_head); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos +// Function: NodePath::set_pos // Access: Published // Description: Sets the translation component of the transform, // leaving rotation and scale untouched. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_pos(float x, float y, float z) { set_pos(LPoint3f(x, y, z)); } -INLINE float qpNodePath:: +INLINE float NodePath:: get_x() const { return get_pos()[0]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_y() const { return get_pos()[1]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_z() const { return get_pos()[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr +// Function: NodePath::set_hpr // Access: Published // Description: Sets the rotation component of the transform, // leaving translation and scale untouched. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_hpr(float h, float p, float r) { set_hpr(LVecBase3f(h, p, r)); } -INLINE float qpNodePath:: +INLINE float NodePath:: get_h() const { return get_hpr()[0]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_p() const { return get_hpr()[1]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_r() const { return get_hpr()[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_scale +// Function: NodePath::set_scale // Access: Published // Description: Sets the scale component of the transform, // leaving translation and rotation untouched. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_scale(float scale) { set_scale(LVecBase3f(scale, scale, scale)); } -INLINE void qpNodePath:: +INLINE void NodePath:: set_scale(float sx, float sy, float sz) { set_scale(LVecBase3f(sx, sy, sz)); } -INLINE float qpNodePath:: +INLINE float NodePath:: get_sx() const { return get_scale()[0]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_sy() const { return get_scale()[1]; } -INLINE float qpNodePath:: +INLINE float NodePath:: get_sz() const { return get_scale()[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr +// Function: NodePath::set_pos_hpr // Access: Published // Description: Sets the translation and rotation component of the // transform, leaving scale untouched. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_pos_hpr(float x, float y, float z, float h, float p, float r) { set_pos_hpr(LVecBase3f(x, y, z), LVecBase3f(h, p, r)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr_scale +// Function: NodePath::set_hpr_scale // Access: Published // Description: Sets the rotation and scale components of the // transform, leaving translation untouched. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_hpr_scale(float h, float p, float r, float sx, float sy, float sz) { set_hpr_scale(LVecBase3f(h, p, r), LVecBase3f(sx, sy, sz)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr_scale +// Function: NodePath::set_pos_hpr_scale // Access: Published // Description: Completely replaces the transform with new // translation, rotation, and scale components. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_pos_hpr_scale(float x, float y, float z, float h, float p, float r, float sx, float sy, float sz) { set_pos_hpr_scale(LVecBase3f(x, y, z), LVecBase3f(h, p, r), @@ -556,37 +556,37 @@ set_pos_hpr_scale(float x, float y, float z, float h, float p, float r, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_mat +// Function: NodePath::clear_mat // Access: Published // Description: Completely removes any transform from the referenced // node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: clear_mat() { nassertv_always(!is_empty()); node()->clear_transform(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_mat +// Function: NodePath::has_mat // Access: Published // Description: Returns true if a non-identity transform matrix has // been applied to the referenced node, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: has_mat() const { nassertr_always(!is_empty(), false); return !node()->get_transform()->is_identity(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_mat +// Function: NodePath::get_mat // Access: Published // Description: Returns the transform matrix that has been applied to // the referenced node, or the identity matrix if no // matrix has been applied. //////////////////////////////////////////////////////////////////// -INLINE const LMatrix4f &qpNodePath:: +INLINE const LMatrix4f &NodePath:: get_mat() const { nassertr_always(!is_empty(), LMatrix4f::ident_mat()); @@ -594,21 +594,21 @@ get_mat() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_color_scale +// Function: NodePath::set_color_scale // Access: Published // Description: Sets the color scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_color_scale(float sr, float sg, float sb, float sa) { set_color_scale(LVecBase4f(sr, sg, sb, sa)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_sr +// Function: NodePath::set_sr // Access: Published // Description: Sets the red scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_sr(float sr) { LVecBase4f new_scale = get_color_scale(); new_scale[0] = sr; @@ -617,11 +617,11 @@ set_sr(float sr) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_sg +// Function: NodePath::set_sg // Access: Published // Description: Sets the alpha scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_sg(float sg) { LVecBase4f new_scale = get_color_scale(); new_scale[1] = sg; @@ -630,11 +630,11 @@ set_sg(float sg) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_sb +// Function: NodePath::set_sb // Access: Published // Description: Sets the blue scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_sb(float sb) { LVecBase4f new_scale = get_color_scale(); new_scale[2] = sb; @@ -643,11 +643,11 @@ set_sb(float sb) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_sa +// Function: NodePath::set_sa // Access: Published // Description: Sets the alpha scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: set_sa(float sa) { LVecBase4f new_scale = get_color_scale(); new_scale[3] = sa; @@ -656,191 +656,191 @@ set_sa(float sa) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_sr +// Function: NodePath::get_sr // Access: Published // Description: Gets the red scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: +INLINE float NodePath:: get_sr() const { return get_color_scale()[0]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_sg +// Function: NodePath::get_sg // Access: Published // Description: Gets the green scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: +INLINE float NodePath:: get_sg() const { return get_color_scale()[1]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_sb +// Function: NodePath::get_sb // Access: Published // Description: Gets the blue scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: +INLINE float NodePath:: get_sb() const { return get_color_scale()[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_sa +// Function: NodePath::get_sa // Access: Published // Description: Gets the alpha scale component of the transform //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: +INLINE float NodePath:: get_sa() const { return get_color_scale()[3]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::look_at +// Function: NodePath::look_at // Access: Published -// Description: Sets the transform on this qpNodePath so that it +// Description: Sets the transform on this NodePath so that it // rotates to face the indicated point in space. This // will overwrite any previously existing scale on the // node, although it will preserve any translation. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: look_at(float x, float y, float z) { look_at(LPoint3f(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::heads_up +// Function: NodePath::heads_up // Access: Published // Description: Behaves like look_at(), but with a strong preference // to keeping the up vector oriented in the indicated // "up" direction. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: heads_up(float x, float y, float z) { heads_up(LPoint3f(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos +// Function: NodePath::set_pos // Access: Published // Description: Sets the translation component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_pos(const qpNodePath &other, float x, float y, float z) { +INLINE void NodePath:: +set_pos(const NodePath &other, float x, float y, float z) { set_pos(other, LPoint3f(x, y, z)); } -INLINE float qpNodePath:: -get_x(const qpNodePath &other) const { +INLINE float NodePath:: +get_x(const NodePath &other) const { return get_pos(other)[0]; } -INLINE float qpNodePath:: -get_y(const qpNodePath &other) const { +INLINE float NodePath:: +get_y(const NodePath &other) const { return get_pos(other)[1]; } -INLINE float qpNodePath:: -get_z(const qpNodePath &other) const { +INLINE float NodePath:: +get_z(const NodePath &other) const { return get_pos(other)[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr +// Function: NodePath::set_hpr // Access: Published // Description: Sets the rotation component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_hpr(const qpNodePath &other, float h, float p, float r) { +INLINE void NodePath:: +set_hpr(const NodePath &other, float h, float p, float r) { set_hpr(other, LPoint3f(h, p, r)); } -INLINE float qpNodePath:: -get_h(const qpNodePath &other) const { +INLINE float NodePath:: +get_h(const NodePath &other) const { return get_hpr(other)[0]; } -INLINE float qpNodePath:: -get_p(const qpNodePath &other) const { +INLINE float NodePath:: +get_p(const NodePath &other) const { return get_hpr(other)[1]; } -INLINE float qpNodePath:: -get_r(const qpNodePath &other) const { +INLINE float NodePath:: +get_r(const NodePath &other) const { return get_hpr(other)[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_scale +// Function: NodePath::set_scale // Access: Published // Description: Sets the scale component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_scale(const qpNodePath &other, float sx, float sy, float sz) { +INLINE void NodePath:: +set_scale(const NodePath &other, float sx, float sy, float sz) { set_scale(other, LPoint3f(sx, sy, sz)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_scale +// Function: NodePath::get_scale // Access: Published // Description: Returns the relative scale of the referenced node // as seen from the other node. //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: -get_sx(const qpNodePath &other) const { +INLINE float NodePath:: +get_sx(const NodePath &other) const { return get_scale(other)[0]; } -INLINE float qpNodePath:: -get_sy(const qpNodePath &other) const { +INLINE float NodePath:: +get_sy(const NodePath &other) const { return get_scale(other)[1]; } -INLINE float qpNodePath:: -get_sz(const qpNodePath &other) const { +INLINE float NodePath:: +get_sz(const NodePath &other) const { return get_scale(other)[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr +// Function: NodePath::set_pos_hpr // Access: Published // Description: Sets the translation and rotation component of the // transform, relative to the other node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_pos_hpr(const qpNodePath &other, +INLINE void NodePath:: +set_pos_hpr(const NodePath &other, float x, float y, float z, float h, float p, float r) { set_pos_hpr(other, LVecBase3f(x, y, z), LVecBase3f(h, p, r)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr_scale +// Function: NodePath::set_hpr_scale // Access: Published // Description: Sets the rotation and scale components of the // transform, leaving translation untouched. This, or // set_pos_hpr_scale, is the preferred way to update a // transform when both hpr and scale are to be changed. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_hpr_scale(const qpNodePath &other, +INLINE void NodePath:: +set_hpr_scale(const NodePath &other, float h, float p, float r, float sx, float sy, float sz) { set_hpr_scale(other, LVecBase3f(h, p, r), LVecBase3f(sx, sy, sz)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr_scale +// Function: NodePath::set_pos_hpr_scale // Access: Published // Description: Completely replaces the transform with new // translation, rotation, and scale components, relative // to the other node. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -set_pos_hpr_scale(const qpNodePath &other, +INLINE void NodePath:: +set_pos_hpr_scale(const NodePath &other, float x, float y, float z, float h, float p, float r, float sx, float sy, float sz) { @@ -849,44 +849,44 @@ set_pos_hpr_scale(const qpNodePath &other, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::look_at +// Function: NodePath::look_at // Access: Published // Description: Sets the hpr on this NodePath so that it rotates to // face the indicated point in space, which is relative // to the other NodePath. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -look_at(const qpNodePath &other, float x, float y, float z) { +INLINE void NodePath:: +look_at(const NodePath &other, float x, float y, float z) { look_at(other, LPoint3f(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::heads_up +// Function: NodePath::heads_up // Access: Published // Description: Behaves like look_at(), but with a strong preference // to keeping the up vector oriented in the indicated // "up" direction. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: -heads_up(const qpNodePath &other, float x, float y, float z) { +INLINE void NodePath:: +heads_up(const NodePath &other, float x, float y, float z) { heads_up(other, LPoint3f(x, y, z)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_distance +// Function: NodePath::get_distance // Access: Published // Description: Returns the straight-line distance between this // referenced node's coordinate frame's origin, and that // of the other node's origin. //////////////////////////////////////////////////////////////////// -INLINE float qpNodePath:: -get_distance(const qpNodePath &other) const { +INLINE float NodePath:: +get_distance(const NodePath &other) const { LPoint3f pos = get_pos(other); return length(LVector3f(pos)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::adjust_all_priorities +// Function: NodePath::adjust_all_priorities // Access: Published // Description: Adds the indicated adjustment amount (which may be // negative) to the priority for all transitions on the @@ -896,41 +896,41 @@ get_distance(const qpNodePath &other) const { // the priority would drop below zero, it is set to // zero. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: adjust_all_priorities(int adjustment) { nassertv_always(!is_empty()); r_adjust_all_priorities(node(), adjustment); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::show +// Function: NodePath::show // Access: Published // Description: Undoes the effect of a previous hide() on this node: // makes the referenced node (and the entire subgraph // below this node) visible to all cameras. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: show() { nassertv_always(!is_empty()); node()->set_draw_mask(DrawMask::all_on()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::show +// Function: NodePath::show // Access: Published // Description: Makes the referenced node visible just to the // cameras whose camera_mask shares the indicated bits. // That is, this sets the indicated bits in the // node's draw mask. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: show(DrawMask camera_mask) { nassertv_always(!is_empty()); node()->set_draw_mask(node()->get_draw_mask() | camera_mask); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::hide +// Function: NodePath::hide // Access: Published // Description: Makes the referenced node (and the entire subgraph // below this node) invisible to all cameras. It @@ -938,40 +938,40 @@ show(DrawMask camera_mask) { // still contributes to its parent's bounding volume, // and it will still be involved in collision tests. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: hide() { nassertv_always(!is_empty()); node()->set_draw_mask(DrawMask::all_off()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::hide +// Function: NodePath::hide // Access: Published // Description: Makes the referenced node invisible just to the // cameras whose camera_mask shares the indicated bits. // That is, this clears the indicated bits from the // node's draw mask. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePath:: +INLINE void NodePath:: hide(DrawMask camera_mask) { nassertv_always(!is_empty()); node()->set_draw_mask(node()->get_draw_mask() & ~camera_mask); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::is_hidden +// Function: NodePath::is_hidden // Access: Published // Description: Returns true if the referenced node is hidden from // the indicated camera(s) either directly, or because // some ancestor is hidden. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: is_hidden(DrawMask camera_mask) const { return !get_hidden_ancestor(camera_mask).is_empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::unstash +// Function: NodePath::unstash // Access: Published // Description: Undoes the effect of a previous stash() on this // node: makes the referenced node (and the entire @@ -979,14 +979,14 @@ is_hidden(DrawMask camera_mask) const { // scene graph. Returns true if the node is unstashed, // or false if it wasn't stashed to begin with. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: unstash() { nassertr(!is_singleton(), false); return get_parent().node()->unstash_child(node()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::stash +// Function: NodePath::stash // Access: Published // Description: Removes the referenced node (and the entire subgraph // below this node) from the scene graph in any normal @@ -1003,76 +1003,76 @@ unstash() { // Returns true if the node is successfully stashed, or // false if it was already stashed. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: stash() { nassertr(!is_singleton(), false); return get_parent().node()->stash_child(node()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::is_stashed +// Function: NodePath::is_stashed // Access: Published // Description: Returns true if the referenced node is stashed either // directly, or because some ancestor is stashed. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: +INLINE bool NodePath:: is_stashed() const { return !get_stashed_ancestor().is_empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::operator == +// Function: NodePath::operator == // Access: Published // Description: Returns true if the two paths are equivalent; that // is, if they contain the same list of nodes in the same // order. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: -operator == (const qpNodePath &other) const { +INLINE bool NodePath:: +operator == (const NodePath &other) const { return (compare_to(other) == 0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::operator != +// Function: NodePath::operator != // Access: Published // Description: Returns true if the two paths are not equivalent. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: -operator != (const qpNodePath &other) const { +INLINE bool NodePath:: +operator != (const NodePath &other) const { return (compare_to(other) != 0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::operator < +// Function: NodePath::operator < // Access: Published -// Description: Returns true if this qpNodePath sorts before the other +// Description: Returns true if this NodePath sorts before the other // one, false otherwise. The sorting order of two -// nonequivalent qpNodePaths is consistent but undefined, -// and is useful only for storing qpNodePaths in a sorted +// nonequivalent NodePaths is consistent but undefined, +// and is useful only for storing NodePaths in a sorted // container like an STL set. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePath:: -operator < (const qpNodePath &other) const { +INLINE bool NodePath:: +operator < (const NodePath &other) const { return (compare_to(other) < 0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::compare_to +// Function: NodePath::compare_to // Access: Published -// Description: Returns a number less than zero if this qpNodePath +// Description: Returns a number less than zero if this NodePath // sorts before the other one, greater than zero if it // sorts after, or zero if they are equivalent. // -// Two qpNodePaths are considered equivalent if they +// Two NodePaths are considered equivalent if they // consist of exactly the same list of nodes in the same // order. Otherwise, they are different; different -// qpNodePaths will be ranked in a consistent but +// NodePaths will be ranked in a consistent but // undefined ordering; the ordering is useful only for -// placing the qpNodePaths in a sorted container like an +// placing the NodePaths in a sorted container like an // STL set. //////////////////////////////////////////////////////////////////// -INLINE int qpNodePath:: -compare_to(const qpNodePath &other) const { +INLINE int NodePath:: +compare_to(const NodePath &other) const { uncollapse_head(); other.uncollapse_head(); @@ -1083,7 +1083,7 @@ compare_to(const qpNodePath &other) const { } -INLINE ostream &operator << (ostream &out, const qpNodePath &node_path) { +INLINE ostream &operator << (ostream &out, const NodePath &node_path) { node_path.output(out); return out; } diff --git a/panda/src/pgraph/qpnodePath.cxx b/panda/src/pgraph/nodePath.cxx similarity index 86% rename from panda/src/pgraph/qpnodePath.cxx rename to panda/src/pgraph/nodePath.cxx index f3064fa77b..e23019a298 100644 --- a/panda/src/pgraph/qpnodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -1,4 +1,4 @@ -// Filename: qpnodePath.cxx +// Filename: nodePath.cxx // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,11 +16,11 @@ // //////////////////////////////////////////////////////////////////// -#include "qpnodePath.h" -#include "qpnodePathCollection.h" -#include "qpfindApproxPath.h" -#include "qpfindApproxLevelEntry.h" -#include "qpfindApproxLevel.h" +#include "nodePath.h" +#include "nodePathCollection.h" +#include "findApproxPath.h" +#include "findApproxLevelEntry.h" +#include "findApproxLevel.h" #include "config_pgraph.h" #include "colorAttrib.h" #include "colorScaleAttrib.h" @@ -40,8 +40,8 @@ #include "compose_matrix.h" #include "plist.h" #include "boundingSphere.h" -#include "qpgeomNode.h" -#include "qpsceneGraphReducer.h" +#include "geomNode.h" +#include "sceneGraphReducer.h" #include "textureCollection.h" #include "globPattern.h" #include "config_gobj.h" @@ -49,15 +49,15 @@ // stack seems to overflow on Intel C++ at 7000. If we need more than // 7000, need to increase stack size. -int qpNodePath::_max_search_depth = 7000; -TypeHandle qpNodePath::_type_handle; +int NodePath::_max_search_depth = 7000; +TypeHandle NodePath::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_num_nodes +// Function: NodePath::get_num_nodes // Access: Published // Description: Returns the number of nodes in the path. //////////////////////////////////////////////////////////////////// -int qpNodePath:: +int NodePath:: get_num_nodes() const { if (is_empty()) { return 0; @@ -67,50 +67,50 @@ get_num_nodes() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_node +// Function: NodePath::get_node // Access: Published // Description: Returns the nth node of the path, where 0 is the // referenced (bottom) node and get_num_nodes() - 1 is // the top node. This requires iterating through the // path. //////////////////////////////////////////////////////////////////// -PandaNode *qpNodePath:: +PandaNode *NodePath:: get_node(int index) const { nassertr(index >= 0 && index < get_num_nodes(), NULL); uncollapse_head(); - qpNodePathComponent *comp = _head; + NodePathComponent *comp = _head; while (index > 0) { // If this assertion fails, the index was out of range; the // component's length must have been invalid. - nassertr(comp != (qpNodePathComponent *)NULL, NULL); + nassertr(comp != (NodePathComponent *)NULL, NULL); comp = comp->get_next(); index--; } // If this assertion fails, the index was out of range; the // component's length must have been invalid. - nassertr(comp != (qpNodePathComponent *)NULL, NULL); + nassertr(comp != (NodePathComponent *)NULL, NULL); return comp->get_node(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_top_node +// Function: NodePath::get_top_node // Access: Published // Description: Returns the top node of the path, or NULL if the path // is empty. This requires iterating through the path. //////////////////////////////////////////////////////////////////// -PandaNode *qpNodePath:: +PandaNode *NodePath:: get_top_node() const { if (is_empty()) { return (PandaNode *)NULL; } uncollapse_head(); - qpNodePathComponent *comp = _head; + NodePathComponent *comp = _head; while (!comp->is_top_node()) { comp = comp->get_next(); - nassertr(comp != (qpNodePathComponent *)NULL, NULL); + nassertr(comp != (NodePathComponent *)NULL, NULL); } return comp->get_node(); @@ -118,14 +118,14 @@ get_top_node() const { //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_children +// Function: NodePath::get_children // Access: Published // Description: Returns the set of all child nodes of the referenced // node. //////////////////////////////////////////////////////////////////// -qpNodePathCollection qpNodePath:: +NodePathCollection NodePath:: get_children() const { - qpNodePathCollection result; + NodePathCollection result; nassertr_always(!is_empty(), result); PandaNode *bottom_node = node(); @@ -133,7 +133,7 @@ get_children() const { PandaNode::Children cr = bottom_node->get_children(); int num_children = cr.get_num_children(); for (int i = 0; i < num_children; i++) { - qpNodePath child; + NodePath child; child._head = PandaNode::get_component(_head, cr.get_child(i)); result.add_path(child); } @@ -142,62 +142,62 @@ get_children() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find +// Function: NodePath::find // Access: Published // Description: Searches for a node below the referenced node that // matches the indicated string. Returns the shortest // match found, if any, or an empty NodePath if no match // can be found. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: +NodePath NodePath:: find(const string &path) const { nassertr_always(!is_empty(), fail()); - qpNodePathCollection col; + NodePathCollection col; find_matches(col, path, 1); if (col.is_empty()) { - return qpNodePath::not_found(); + return NodePath::not_found(); } return col.get_path(0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_path_to +// Function: NodePath::find_path_to // Access: Published // Description: Searches for the indicated node below this node and // returns the shortest NodePath that connects them. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: +NodePath NodePath:: find_path_to(PandaNode *node) const { nassertr_always(!is_empty(), fail()); nassertr(node != (PandaNode *)NULL, fail()); - qpNodePathCollection col; - qpFindApproxPath approx_path; + NodePathCollection col; + FindApproxPath approx_path; approx_path.add_match_many(0); approx_path.add_match_pointer(node, 0); find_matches(col, approx_path, 1); if (col.is_empty()) { - return qpNodePath::not_found(); + return NodePath::not_found(); } return col.get_path(0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_all_matches +// Function: NodePath::find_all_matches // Access: Published // Description: Returns the complete set of all NodePaths that begin // with this NodePath and can be extended by // path. The shortest paths will be listed // first. //////////////////////////////////////////////////////////////////// -qpNodePathCollection qpNodePath:: +NodePathCollection NodePath:: find_all_matches(const string &path) const { - qpNodePathCollection col; + NodePathCollection col; nassertr_always(!is_empty(), col); nassertr(verify_complete(), col); find_matches(col, path, -1); @@ -205,19 +205,19 @@ find_all_matches(const string &path) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_all_paths_to +// Function: NodePath::find_all_paths_to // Access: Published // Description: Returns the set of all NodePaths that extend from // this NodePath down to the indicated node. The // shortest paths will be listed first. //////////////////////////////////////////////////////////////////// -qpNodePathCollection qpNodePath:: +NodePathCollection NodePath:: find_all_paths_to(PandaNode *node) const { - qpNodePathCollection col; + NodePathCollection col; nassertr_always(!is_empty(), col); nassertr(verify_complete(), col); nassertr(node != (PandaNode *)NULL, col); - qpFindApproxPath approx_path; + FindApproxPath approx_path; approx_path.add_match_many(0); approx_path.add_match_pointer(node, 0); find_matches(col, approx_path, -1); @@ -225,14 +225,14 @@ find_all_paths_to(PandaNode *node) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::reparent_to +// Function: NodePath::reparent_to // Access: Published -// Description: Removes the referenced node of the qpNodePath from its +// Description: Removes the referenced node of the NodePath from its // current parent and attaches it to the referenced node of -// the indicated qpNodePath. +// the indicated NodePath. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -reparent_to(const qpNodePath &other, int sort) { +void NodePath:: +reparent_to(const NodePath &other, int sort) { nassertv(verify_complete()); nassertv(other.verify_complete()); nassertv_always(!is_empty()); @@ -244,7 +244,7 @@ reparent_to(const qpNodePath &other, int sort) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::wrt_reparent_to +// Function: NodePath::wrt_reparent_to // Access: Published // Description: This functions identically to reparent_to(), except // the transform on this node is also adjusted so that @@ -252,8 +252,8 @@ reparent_to(const qpNodePath &other, int sort) { // coordinates, even if it is reparented into a // different coordinate system. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -wrt_reparent_to(const qpNodePath &other, int sort) { +void NodePath:: +wrt_reparent_to(const NodePath &other, int sort) { nassertv(verify_complete()); nassertv(other.verify_complete()); nassertv_always(!is_empty()); @@ -264,7 +264,7 @@ wrt_reparent_to(const qpNodePath &other, int sort) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::instance_to +// Function: NodePath::instance_to // Access: Published // Description: Adds the referenced node of the NodePath as a child // of the referenced node of the indicated other @@ -280,24 +280,24 @@ wrt_reparent_to(const qpNodePath &other, int sort) { // return a new NodePath that reflects the new instance // node. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: -instance_to(const qpNodePath &other, int sort) const { - nassertr(verify_complete(), qpNodePath::fail()); - nassertr(other.verify_complete(), qpNodePath::fail()); - nassertr_always(!is_empty(), qpNodePath::fail()); - nassertr(!other.is_empty(), qpNodePath::fail()); +NodePath NodePath:: +instance_to(const NodePath &other, int sort) const { + nassertr(verify_complete(), NodePath::fail()); + nassertr(other.verify_complete(), NodePath::fail()); + nassertr_always(!is_empty(), NodePath::fail()); + nassertr(!other.is_empty(), NodePath::fail()); uncollapse_head(); other.uncollapse_head(); - qpNodePath new_instance; + NodePath new_instance; new_instance._head = PandaNode::attach(other._head, node(), sort); return new_instance; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::instance_under_node +// Function: NodePath::instance_under_node // Access: Published // Description: Behaves like instance_to(), but implicitly creates a // new node to instance the geometry under, and returns a @@ -305,10 +305,10 @@ instance_to(const qpNodePath &other, int sort) const { // programmer to set a unique state and/or transform on // this instance. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: -instance_under_node(const qpNodePath &other, const string &name, int sort) const { - qpNodePath new_node = other.attach_new_node(name, sort); - qpNodePath instance = instance_to(new_node); +NodePath NodePath:: +instance_under_node(const NodePath &other, const string &name, int sort) const { + NodePath new_node = other.attach_new_node(name, sort); + NodePath instance = instance_to(new_node); if (instance.is_empty()) { new_node.remove_node(); return instance; @@ -317,16 +317,16 @@ instance_under_node(const qpNodePath &other, const string &name, int sort) const } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::copy_to +// Function: NodePath::copy_to // Access: Published // Description: Functions exactly like instance_to(), except a deep // copy is made of the referenced node and all of its // descendents, which is then parented to the indicated -// node. A qpNodePath to the newly created copy is +// node. A NodePath to the newly created copy is // returned. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: -copy_to(const qpNodePath &other, int sort) const { +NodePath NodePath:: +copy_to(const NodePath &other, int sort) const { nassertr(verify_complete(), fail()); nassertr(other.verify_complete(), fail()); nassertr_always(!is_empty(), fail()); @@ -340,7 +340,7 @@ copy_to(const qpNodePath &other, int sort) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::attach_new_node +// Function: NodePath::attach_new_node // Access: Published // Description: Attaches a new node, with or without existing // parents, to the scene graph below the referenced node @@ -352,20 +352,20 @@ copy_to(const qpNodePath &other, int sort) const { // NodePath that does reflect this extension is // returned. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: +NodePath NodePath:: attach_new_node(PandaNode *node, int sort) const { - nassertr(verify_complete(), qpNodePath::fail()); - nassertr_always(!is_empty(), qpNodePath()); - nassertr(node != (PandaNode *)NULL, qpNodePath()); + nassertr(verify_complete(), NodePath::fail()); + nassertr_always(!is_empty(), NodePath()); + nassertr(node != (PandaNode *)NULL, NodePath()); uncollapse_head(); - qpNodePath new_path(*this); + NodePath new_path(*this); new_path._head = PandaNode::attach(_head, node, sort); return new_path; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::remove_node +// Function: NodePath::remove_node // Access: Published // Description: Disconnects the referenced node from the scene graph. // This will also delete the node if there are no other @@ -377,27 +377,27 @@ attach_new_node(PandaNode *node, int sort) const { // later, you should probably use reparent_to() and put // it under a holding node instead. // -// After the node is removed, the qpNodePath will have +// After the node is removed, the NodePath will have // been cleared. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: remove_node() { nassertv(_error_type != ET_not_found); // If we have no parents, remove_node() is just a do-nothing // operation; if we have no nodes, maybe we were already removed. // In either case, quietly do nothing except to ensure the - // qpNodePath is clear. + // NodePath is clear. if (!is_empty() && !is_singleton()) { uncollapse_head(); PandaNode::detach(_head); } - (*this) = qpNodePath::removed(); + (*this) = NodePath::removed(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::detach_node +// Function: NodePath::detach_node // Access: Published // Description: Disconnects the referenced node from its parent, but // does not immediately delete it. The NodePath retains @@ -410,7 +410,7 @@ remove_node() { // reassigned to something else, this will have the same // effect as remove_node(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: detach_node() { nassertv(_error_type != ET_not_found); if (!is_empty() && !is_singleton()) { @@ -420,12 +420,12 @@ detach_node() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::output +// Function: NodePath::output // Access: Published -// Description: Writes a sensible description of the qpNodePath to the +// Description: Writes a sensible description of the NodePath to the // indicated output stream. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: output(ostream &out) const { uncollapse_head(); @@ -443,7 +443,7 @@ output(ostream &out) const { break; } - if (_head == (qpNodePathComponent *)NULL) { + if (_head == (NodePathComponent *)NULL) { out << "(empty)"; } else { r_output(out, _head); @@ -451,14 +451,14 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_state +// Function: NodePath::get_state // Access: Published // Description: Returns the state changes that must be made to // transition from the render state of this node to the // render state of the other node. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpNodePath:: -get_state(const qpNodePath &other) const { +CPT(RenderState) NodePath:: +get_state(const NodePath &other) const { if (is_empty()) { return other.get_net_state(); } @@ -478,20 +478,20 @@ get_state(const qpNodePath &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_state +// Function: NodePath::set_state // Access: Published // Description: Sets the state object on this node, relative to // the other node. This computes a new state object // that has the indicated value when seen relative to // the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_state(const qpNodePath &other, const RenderState *state) const { +void NodePath:: +set_state(const NodePath &other, const RenderState *state) const { nassertv(_error_type == ET_ok && other._error_type == ET_ok); nassertv_always(!is_empty()); // First, we perform a wrt to the parent, to get the conversion. - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); CPT(RenderState) rel_state = parent.get_state(other); CPT(RenderState) new_state = rel_state->compose(state); @@ -499,14 +499,14 @@ set_state(const qpNodePath &other, const RenderState *state) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_transform +// Function: NodePath::get_transform // Access: Published // Description: Returns the relative transform to this node from the // other node; i.e. the transformation of this node // as seen from the other node. //////////////////////////////////////////////////////////////////// -CPT(TransformState) qpNodePath:: -get_transform(const qpNodePath &other) const { +CPT(TransformState) NodePath:: +get_transform(const NodePath &other) const { if (other.is_empty()) { return get_net_transform(); } @@ -526,20 +526,20 @@ get_transform(const qpNodePath &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_transform +// Function: NodePath::set_transform // Access: Published // Description: Sets the transform object on this node, relative to // the other node. This computes a new transform object // that will have the indicated value when seen from the // other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_transform(const qpNodePath &other, const TransformState *transform) const { +void NodePath:: +set_transform(const NodePath &other, const TransformState *transform) const { nassertv(_error_type == ET_ok && other._error_type == ET_ok); nassertv_always(!is_empty()); // First, we perform a wrt to the parent, to get the conversion. - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); CPT(TransformState) rel_trans = other.get_transform(parent); CPT(TransformState) new_trans = rel_trans->compose(transform); @@ -547,18 +547,18 @@ set_transform(const qpNodePath &other, const TransformState *transform) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos +// Function: NodePath::set_pos // Access: Published // Description: Sets the translation component of the transform, // leaving rotation and scale untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_pos(const LVecBase3f &pos) { nassertv_always(!is_empty()); set_transform(get_transform()->set_pos(pos)); } -void qpNodePath:: +void NodePath:: set_x(float x) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(); @@ -566,7 +566,7 @@ set_x(float x) { set_pos(pos); } -void qpNodePath:: +void NodePath:: set_y(float y) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(); @@ -574,7 +574,7 @@ set_y(float y) { set_pos(pos); } -void qpNodePath:: +void NodePath:: set_z(float z) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(); @@ -583,23 +583,23 @@ set_z(float z) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_pos +// Function: NodePath::get_pos // Access: Published // Description: Retrieves the translation component of the transform. //////////////////////////////////////////////////////////////////// -LPoint3f qpNodePath:: +LPoint3f NodePath:: get_pos() const { nassertr_always(!is_empty(), LPoint3f(0.0f, 0.0f, 0.0f)); return get_transform()->get_pos(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr +// Function: NodePath::set_hpr // Access: Published // Description: Sets the rotation component of the transform, // leaving translation and scale untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_hpr(const LVecBase3f &hpr) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -607,7 +607,7 @@ set_hpr(const LVecBase3f &hpr) { set_transform(transform->set_hpr(hpr)); } -void qpNodePath:: +void NodePath:: set_h(float h) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -617,7 +617,7 @@ set_h(float h) { set_transform(transform->set_hpr(hpr)); } -void qpNodePath:: +void NodePath:: set_p(float p) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -627,7 +627,7 @@ set_p(float p) { set_transform(transform->set_hpr(hpr)); } -void qpNodePath:: +void NodePath:: set_r(float r) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -638,11 +638,11 @@ set_r(float r) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_hpr +// Function: NodePath::get_hpr // Access: Published // Description: Retrieves the rotation component of the transform. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: +LVecBase3f NodePath:: get_hpr() const { nassertr_always(!is_empty(), LVecBase3f(0.0f, 0.0f, 0.0f)); CPT(TransformState) transform = get_transform(); @@ -651,11 +651,11 @@ get_hpr() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_hpr +// Function: NodePath::get_hpr // Access: Published // Description: Retrieves the rotation component of the transform. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: +LVecBase3f NodePath:: get_hpr(float roll) const { // This function is deprecated. It used to be a hack to work around // a problem with decomposing Euler angles, but since we no longer @@ -664,12 +664,12 @@ get_hpr(float roll) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_scale +// Function: NodePath::set_scale // Access: Published // Description: Sets the scale component of the transform, // leaving translation and rotation untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_scale(const LVecBase3f &scale) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -677,7 +677,7 @@ set_scale(const LVecBase3f &scale) { set_transform(transform->set_scale(scale)); } -void qpNodePath:: +void NodePath:: set_sx(float sx) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -687,7 +687,7 @@ set_sx(float sx) { set_transform(transform->set_scale(scale)); } -void qpNodePath:: +void NodePath:: set_sy(float sy) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -697,7 +697,7 @@ set_sy(float sy) { set_transform(transform->set_scale(scale)); } -void qpNodePath:: +void NodePath:: set_sz(float sz) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -708,11 +708,11 @@ set_sz(float sz) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_scale +// Function: NodePath::get_scale // Access: Published // Description: Retrieves the scale component of the transform. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: +LVecBase3f NodePath:: get_scale() const { nassertr_always(!is_empty(), LVecBase3f(0.0f, 0.0f, 0.0f)); CPT(TransformState) transform = get_transform(); @@ -721,12 +721,12 @@ get_scale() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr +// Function: NodePath::set_pos_hpr // Access: Published // Description: Sets the translation and rotation component of the // transform, leaving scale untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_pos_hpr(const LVecBase3f &pos, const LVecBase3f &hpr) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -737,12 +737,12 @@ set_pos_hpr(const LVecBase3f &pos, const LVecBase3f &hpr) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr_scale +// Function: NodePath::set_hpr_scale // Access: Published // Description: Sets the rotation and scale components of the // transform, leaving translation untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_hpr_scale(const LVecBase3f &hpr, const LVecBase3f &scale) { nassertv_always(!is_empty()); CPT(TransformState) transform = get_transform(); @@ -752,12 +752,12 @@ set_hpr_scale(const LVecBase3f &hpr, const LVecBase3f &scale) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr_scale +// Function: NodePath::set_pos_hpr_scale // Access: Published // Description: Completely replaces the transform with new // translation, rotation, and scale components. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_pos_hpr_scale(const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) { nassertv_always(!is_empty()); @@ -766,32 +766,32 @@ set_pos_hpr_scale(const LVecBase3f &pos, const LVecBase3f &hpr, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_mat +// Function: NodePath::set_mat // Access: Published // Description: Directly sets an arbitrary 4x4 transform matrix. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_mat(const LMatrix4f &mat) { nassertv_always(!is_empty()); set_transform(TransformState::make_mat(mat)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_color_scale +// Function: NodePath::has_color_scale // Access: Published // Description: Returns true if a color scale has been applied // to the referenced node, false otherwise. It is still // possible that color at this node might have been // scaled by an ancestor node. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_color_scale() const { nassertr_always(!is_empty(), false); return node()->has_attrib(ColorScaleAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_color_scale +// Function: NodePath::clear_color_scale // Access: Published // Description: Completely removes any color scale from the // referenced node. This is preferable to simply @@ -799,32 +799,32 @@ has_color_scale() const { // removes the overhead associated with having a color // scale at all. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_color_scale() { nassertv_always(!is_empty()); node()->clear_attrib(ColorScaleAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_color_scale +// Function: NodePath::set_color_scale // Access: Published // Description: Sets the color scale component of the transform, // leaving translation and rotation untouched. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_color_scale(const LVecBase4f &scale) { nassertv_always(!is_empty()); node()->set_attrib(ColorScaleAttrib::make(scale)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_color_scale +// Function: NodePath::get_color_scale // Access: Published // Description: Returns the complete color scale vector that has been // applied to the bottom node, or all 1's (identity) if // no scale has been applied. //////////////////////////////////////////////////////////////////// -const LVecBase4f &qpNodePath:: +const LVecBase4f &NodePath:: get_color_scale() const { static const LVecBase4f ident_scale(1.0f, 1.0f, 1.0f, 1.0f); nassertr_always(!is_empty(), ident_scale); @@ -839,12 +839,12 @@ get_color_scale() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::look_at +// Function: NodePath::look_at // Access: Published -// Description: Sets the hpr on this qpNodePath so that it +// Description: Sets the hpr on this NodePath so that it // rotates to face the indicated point in space. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: look_at(const LPoint3f &point, const LVector3f &up) { nassertv_always(!is_empty()); @@ -859,13 +859,13 @@ look_at(const LPoint3f &point, const LVector3f &up) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::heads_up +// Function: NodePath::heads_up // Access: Published // Description: Behaves like look_at(), but with a strong preference // to keeping the up vector oriented in the indicated // "up" direction. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: heads_up(const LPoint3f &point, const LVector3f &up) { nassertv_always(!is_empty()); @@ -880,13 +880,13 @@ heads_up(const LPoint3f &point, const LVector3f &up) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos +// Function: NodePath::set_pos // Access: Published // Description: Sets the translation component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_pos(const qpNodePath &other, const LVecBase3f &pos) { +void NodePath:: +set_pos(const NodePath &other, const LVecBase3f &pos) { nassertv_always(!is_empty()); CPT(TransformState) rel_transform = get_transform(other); @@ -909,24 +909,24 @@ set_pos(const qpNodePath &other, const LVecBase3f &pos) { } } -void qpNodePath:: -set_x(const qpNodePath &other, float x) { +void NodePath:: +set_x(const NodePath &other, float x) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(other); pos[0] = x; set_pos(other, pos); } -void qpNodePath:: -set_y(const qpNodePath &other, float y) { +void NodePath:: +set_y(const NodePath &other, float y) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(other); pos[1] = y; set_pos(other, pos); } -void qpNodePath:: -set_z(const qpNodePath &other, float z) { +void NodePath:: +set_z(const NodePath &other, float z) { nassertv_always(!is_empty()); LPoint3f pos = get_pos(other); pos[2] = z; @@ -934,25 +934,25 @@ set_z(const qpNodePath &other, float z) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_pos +// Function: NodePath::get_pos // Access: Published // Description: Returns the relative position of the referenced node // as seen from the other node. //////////////////////////////////////////////////////////////////// -LPoint3f qpNodePath:: -get_pos(const qpNodePath &other) const { +LPoint3f NodePath:: +get_pos(const NodePath &other) const { nassertr_always(!is_empty(), LPoint3f(0.0f, 0.0f, 0.0f)); return get_transform(other)->get_pos(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr +// Function: NodePath::set_hpr // Access: Published // Description: Sets the rotation component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_hpr(const qpNodePath &other, const LVecBase3f &hpr) { +void NodePath:: +set_hpr(const NodePath &other, const LVecBase3f &hpr) { nassertv_always(!is_empty()); CPT(TransformState) rel_transform = get_transform(other); nassertv(rel_transform->has_components()); @@ -979,24 +979,24 @@ set_hpr(const qpNodePath &other, const LVecBase3f &hpr) { } } -void qpNodePath:: -set_h(const qpNodePath &other, float h) { +void NodePath:: +set_h(const NodePath &other, float h) { nassertv_always(!is_empty()); LVecBase3f hpr = get_hpr(other); hpr[0] = h; set_hpr(other, hpr); } -void qpNodePath:: -set_p(const qpNodePath &other, float p) { +void NodePath:: +set_p(const NodePath &other, float p) { nassertv_always(!is_empty()); LVecBase3f hpr = get_hpr(other); hpr[1] = p; set_hpr(other, hpr); } -void qpNodePath:: -set_r(const qpNodePath &other, float r) { +void NodePath:: +set_r(const NodePath &other, float r) { nassertv_always(!is_empty()); LVecBase3f hpr = get_hpr(other); hpr[2] = r; @@ -1004,13 +1004,13 @@ set_r(const qpNodePath &other, float r) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_hpr +// Function: NodePath::get_hpr // Access: Published // Description: Returns the relative orientation of the bottom node // as seen from the other node. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: -get_hpr(const qpNodePath &other) const { +LVecBase3f NodePath:: +get_hpr(const NodePath &other) const { nassertr_always(!is_empty(), LVecBase3f(0.0f, 0.0f, 0.0f)); CPT(TransformState) transform = get_transform(other); nassertr(transform->has_components(), LVecBase3f(0.0f, 0.0f, 0.0f)); @@ -1018,13 +1018,13 @@ get_hpr(const qpNodePath &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_hpr +// Function: NodePath::get_hpr // Access: Published // Description: Returns the relative orientation of the bottom node // as seen from the other node. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: -get_hpr(const qpNodePath &other, float roll) const { +LVecBase3f NodePath:: +get_hpr(const NodePath &other, float roll) const { // This is still doing it the dumb way, with a decomposition. This // function is deprecated anyway. LMatrix4f mat = get_mat(other); @@ -1034,13 +1034,13 @@ get_hpr(const qpNodePath &other, float roll) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_scale +// Function: NodePath::set_scale // Access: Published // Description: Sets the scale component of the transform, // relative to the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_scale(const qpNodePath &other, const LVecBase3f &scale) { +void NodePath:: +set_scale(const NodePath &other, const LVecBase3f &scale) { nassertv_always(!is_empty()); CPT(TransformState) rel_transform = get_transform(other); nassertv(rel_transform->has_components()); @@ -1067,24 +1067,24 @@ set_scale(const qpNodePath &other, const LVecBase3f &scale) { } } -void qpNodePath:: -set_sx(const qpNodePath &other, float sx) { +void NodePath:: +set_sx(const NodePath &other, float sx) { nassertv_always(!is_empty()); LVecBase3f scale = get_scale(other); scale[0] = sx; set_scale(other, scale); } -void qpNodePath:: -set_sy(const qpNodePath &other, float sy) { +void NodePath:: +set_sy(const NodePath &other, float sy) { nassertv_always(!is_empty()); LVecBase3f scale = get_scale(other); scale[1] = sy; set_scale(other, scale); } -void qpNodePath:: -set_sz(const qpNodePath &other, float sz) { +void NodePath:: +set_sz(const NodePath &other, float sz) { nassertv_always(!is_empty()); LVecBase3f scale = get_scale(other); scale[2] = sz; @@ -1092,13 +1092,13 @@ set_sz(const qpNodePath &other, float sz) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_scale +// Function: NodePath::get_scale // Access: Published // Description: Returns the relative scale of the bottom node // as seen from the other node. //////////////////////////////////////////////////////////////////// -LVecBase3f qpNodePath:: -get_scale(const qpNodePath &other) const { +LVecBase3f NodePath:: +get_scale(const NodePath &other) const { nassertr_always(!is_empty(), LVecBase3f(0.0f, 0.0f, 0.0f)); CPT(TransformState) transform = get_transform(other); nassertr(transform->has_components(), LVecBase3f(0.0f, 0.0f, 0.0f)); @@ -1106,13 +1106,13 @@ get_scale(const qpNodePath &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr +// Function: NodePath::set_pos_hpr // Access: Published // Description: Sets the translation and rotation component of the // transform, relative to the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_pos_hpr(const qpNodePath &other, const LVecBase3f &pos, +void NodePath:: +set_pos_hpr(const NodePath &other, const LVecBase3f &pos, const LVecBase3f &hpr) { nassertv_always(!is_empty()); CPT(TransformState) rel_transform = get_transform(other); @@ -1143,15 +1143,15 @@ set_pos_hpr(const qpNodePath &other, const LVecBase3f &pos, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_hpr_scale +// Function: NodePath::set_hpr_scale // Access: Published // Description: Sets the rotation and scale components of the // transform, leaving translation untouched. This, or // set_pos_hpr_scale, is the preferred way to update a // transform when both hpr and scale are to be changed. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_hpr_scale(const qpNodePath &other, const LVecBase3f &hpr, const LVecBase3f &scale) { +void NodePath:: +set_hpr_scale(const NodePath &other, const LVecBase3f &hpr, const LVecBase3f &scale) { // We don't bother trying very hard to preserve pos across this // operation, unlike the work we do above to preserve hpr or scale, // since it generally doesn't matter that much if pos is off by a @@ -1164,14 +1164,14 @@ set_hpr_scale(const qpNodePath &other, const LVecBase3f &hpr, const LVecBase3f & } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_pos_hpr_scale +// Function: NodePath::set_pos_hpr_scale // Access: Published // Description: Completely replaces the transform with new // translation, rotation, and scale components, relative // to the other node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_pos_hpr_scale(const qpNodePath &other, +void NodePath:: +set_pos_hpr_scale(const NodePath &other, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale) { nassertv_always(!is_empty()); @@ -1180,14 +1180,14 @@ set_pos_hpr_scale(const qpNodePath &other, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_mat +// Function: NodePath::get_mat // Access: Published // Description: Returns the matrix that describes the coordinate // space of the bottom node, relative to the other // path's bottom node's coordinate space. //////////////////////////////////////////////////////////////////// -const LMatrix4f &qpNodePath:: -get_mat(const qpNodePath &other) const { +const LMatrix4f &NodePath:: +get_mat(const NodePath &other) const { CPT(TransformState) transform = get_transform(other); // We can safely assume the transform won't go away when the // function returns, since its reference count is also held in the @@ -1198,45 +1198,45 @@ get_mat(const qpNodePath &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_mat +// Function: NodePath::set_mat // Access: Published // Description: Converts the indicated matrix from the other's // coordinate space to the local coordinate space, and // applies it to the node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_mat(const qpNodePath &other, const LMatrix4f &mat) { +void NodePath:: +set_mat(const NodePath &other, const LMatrix4f &mat) { nassertv_always(!is_empty()); set_transform(other, TransformState::make_mat(mat)); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_relative_point +// Function: NodePath::get_relative_point // Access: Published // Description: Given that the indicated point is in the coordinate // system of the other node, returns the same point in // this node's coordinate system. //////////////////////////////////////////////////////////////////// -LPoint3f qpNodePath:: -get_relative_point(const qpNodePath &other, const LVecBase3f &point) { +LPoint3f NodePath:: +get_relative_point(const NodePath &other, const LVecBase3f &point) { LPoint3f rel_point = LPoint3f(point) * other.get_mat(*this); return rel_point; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::look_at +// Function: NodePath::look_at // Access: Published -// Description: Sets the transform on this qpNodePath so that it +// Description: Sets the transform on this NodePath so that it // rotates to face the indicated point in space, which -// is relative to the other qpNodePath. This +// is relative to the other NodePath. This // will overwrite any previously existing scale on the // node, although it will preserve any translation. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -look_at(const qpNodePath &other, const LPoint3f &point, const LVector3f &up) { +void NodePath:: +look_at(const NodePath &other, const LPoint3f &point, const LVector3f &up) { nassertv_always(!is_empty()); - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); LPoint3f rel_point = point * other.get_mat(parent); LPoint3f pos = get_pos(); @@ -1250,17 +1250,17 @@ look_at(const qpNodePath &other, const LPoint3f &point, const LVector3f &up) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::heads_up +// Function: NodePath::heads_up // Access: Published // Description: Behaves like look_at(), but with a strong preference // to keeping the up vector oriented in the indicated // "up" direction. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -heads_up(const qpNodePath &other, const LPoint3f &point, const LVector3f &up) { +void NodePath:: +heads_up(const NodePath &other, const LPoint3f &point, const LVector3f &up) { nassertv_always(!is_empty()); - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); LPoint3f rel_point = point * other.get_mat(parent); LPoint3f pos = get_pos(); @@ -1274,35 +1274,35 @@ heads_up(const qpNodePath &other, const LPoint3f &point, const LVector3f &up) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_color +// Function: NodePath::set_color // Access: Published // Description: Applies a scene-graph color to the referenced node. // This color will apply to all geometry at this level // and below (that does not specify a new color or a // set_color_off()). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_color(float r, float g, float b, float a, int priority) { set_color(Colorf(r, g, b, a), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_color +// Function: NodePath::set_color // Access: Published // Description: Applies a scene-graph color to the referenced node. // This color will apply to all geometry at this level // and below (that does not specify a new color or a // set_color_off()). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_color(const Colorf &color, int priority) { nassertv_always(!is_empty()); node()->set_attrib(ColorAttrib::make_flat(color), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_color_off +// Function: NodePath::set_color_off // Access: Published // Description: Sets the geometry at this level and below to render // using the geometry color. This is normally the @@ -1311,45 +1311,45 @@ set_color(const Colorf &color, int priority) { // with a priority, to override a set_color() at a lower // level). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_color_off(int priority) { nassertv_always(!is_empty()); node()->set_attrib(ColorAttrib::make_vertex(), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_color +// Function: NodePath::clear_color // Access: Published // Description: Completely removes any color adjustment from the node. // This allows the natural color of the geometry, or // whatever color transitions might be otherwise // affecting the geometry, to show instead. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_color() { nassertv_always(!is_empty()); node()->clear_attrib(ColorAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_color +// Function: NodePath::has_color // Access: Published // Description: Returns true if a color has been applied to the given // node, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_color() const { nassertr_always(!is_empty(), false); return node()->has_attrib(ColorAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_color +// Function: NodePath::get_color // Access: Published // Description: Returns the color that has been assigned to the node, // or black if no color has been assigned. //////////////////////////////////////////////////////////////////// -Colorf qpNodePath:: +Colorf NodePath:: get_color() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1368,7 +1368,7 @@ get_color() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_bin +// Function: NodePath::set_bin // Access: Published // Description: Assigns the geometry at this level and below to the // named rendering bin. It is the user's responsibility @@ -1391,45 +1391,45 @@ get_color() const { // GeomBinFixed type bins, e.g. "fixed". Other kinds of // bins ignore it. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_bin(const string &bin_name, int draw_order, int priority) { nassertv_always(!is_empty()); node()->set_attrib(CullBinAttrib::make(bin_name, draw_order), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_bin +// Function: NodePath::clear_bin // Access: Published // Description: Completely removes any bin adjustment that may have // been set via set_bin() from this particular node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_bin() { nassertv_always(!is_empty()); node()->clear_attrib(CullBinAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_bin +// Function: NodePath::has_bin // Access: Published // Description: Returns true if the node has been assigned to the a // particular rendering bin via set_bin(), false // otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_bin() const { nassertr_always(!is_empty(), false); return node()->has_attrib(CullBinAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_bin_name +// Function: NodePath::get_bin_name // Access: Published // Description: Returns the name of the bin that this particular node // was assigned to via set_bin(), or the empty string if // no bin was assigned. See set_bin() and has_bin(). //////////////////////////////////////////////////////////////////// -string qpNodePath:: +string NodePath:: get_bin_name() const { nassertr_always(!is_empty(), string()); const RenderAttrib *attrib = @@ -1443,14 +1443,14 @@ get_bin_name() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_bin_draw_order +// Function: NodePath::get_bin_draw_order // Access: Published // Description: Returns the drawing order associated with the bin // that this particular node was assigned to via // set_bin(), or 0 if no bin was assigned. See // set_bin() and has_bin(). //////////////////////////////////////////////////////////////////// -int qpNodePath:: +int NodePath:: get_bin_draw_order() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1464,19 +1464,19 @@ get_bin_draw_order() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_texture +// Function: NodePath::set_texture // Access: Published // Description: Sets the geometry at this level and below to render // using the indicated texture. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_texture(Texture *tex, int priority) { nassertv_always(!is_empty()); node()->set_attrib(TextureAttrib::make(tex), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_texture_off +// Function: NodePath::set_texture_off // Access: Published // Description: Sets the geometry at this level and below to render // using no texture. This is normally the default, but @@ -1485,14 +1485,14 @@ set_texture(Texture *tex, int priority) { // priority, to override a set_texture() at a lower // level). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_texture_off(int priority) { nassertv_always(!is_empty()); node()->set_attrib(TextureAttrib::make_off(), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_texture +// Function: NodePath::clear_texture // Access: Published // Description: Completely removes any texture adjustment that may // have been set via set_texture() or set_texture_off() @@ -1500,14 +1500,14 @@ set_texture_off(int priority) { // textures might be otherwise affecting the geometry to // show instead. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_texture() { nassertv_always(!is_empty()); node()->clear_attrib(TextureAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_texture +// Function: NodePath::has_texture // Access: Published // Description: Returns true if a texture has been applied to this // particular node via set_texture(), false otherwise. @@ -1516,7 +1516,7 @@ clear_texture() { // texturing, as there may be a texture in effect from a // higher or lower level. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_texture() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1530,7 +1530,7 @@ has_texture() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_texture_off +// Function: NodePath::has_texture_off // Access: Published // Description: Returns true if a texture has been specifically // disabled on this particular node via @@ -1539,7 +1539,7 @@ has_texture() const { // node will be rendered untextured, as there may be a // texture in effect from a higher or lower level. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_texture_off() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1553,7 +1553,7 @@ has_texture_off() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_texture +// Function: NodePath::get_texture // Access: Published // Description: Returns the texture that has been set on this // particular node, or NULL if no texture has been set. @@ -1564,7 +1564,7 @@ has_texture_off() const { // // See also find_texture(). //////////////////////////////////////////////////////////////////// -Texture *qpNodePath:: +Texture *NodePath:: get_texture() const { nassertr_always(!is_empty(), NULL); const RenderAttrib *attrib = @@ -1578,26 +1578,26 @@ get_texture() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_texture +// Function: NodePath::find_texture // Access: Published // Description: Returns the first texture found applied to geometry // at this node or below that matches the indicated name // (which may contain wildcards). Returns the texture // if it is found, or NULL if it is not. //////////////////////////////////////////////////////////////////// -Texture *qpNodePath:: +Texture *NodePath:: find_texture(const string &name) const { GlobPattern glob(name); return r_find_texture(node(), get_net_state(), glob); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_all_textures +// Function: NodePath::find_all_textures // Access: Published // Description: Returns a list of a textures applied to geometry at // this node and below. //////////////////////////////////////////////////////////////////// -TextureCollection qpNodePath:: +TextureCollection NodePath:: find_all_textures() const { Textures textures; r_find_all_textures(node(), get_net_state(), textures); @@ -1611,13 +1611,13 @@ find_all_textures() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_all_textures +// Function: NodePath::find_all_textures // Access: Published // Description: Returns a list of a textures applied to geometry at // this node and below that match the indicated name // (which may contain wildcard characters). //////////////////////////////////////////////////////////////////// -TextureCollection qpNodePath:: +TextureCollection NodePath:: find_all_textures(const string &name) const { Textures textures; r_find_all_textures(node(), get_net_state(), textures); @@ -1636,7 +1636,7 @@ find_all_textures(const string &name) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_material +// Function: NodePath::set_material // Access: Published // Description: Sets the geometry at this level and below to render // using the indicated material. @@ -1645,7 +1645,7 @@ find_all_textures(const string &name) const { // the material structure is changed later, it must be // reapplied via another call to set_material(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_material(Material *mat, int priority) { nassertv_always(!is_empty()); nassertv(mat != NULL); @@ -1662,7 +1662,7 @@ set_material(Material *mat, int priority) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_material_off +// Function: NodePath::set_material_off // Access: Published // Description: Sets the geometry at this level and below to render // using no material. This is normally the default, but @@ -1671,32 +1671,32 @@ set_material(Material *mat, int priority) { // priority, to override a set_material() at a lower // level). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_material_off(int priority) { nassertv_always(!is_empty()); node()->set_attrib(MaterialAttrib::make_off(), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_material +// Function: NodePath::clear_material // Access: Published // Description: Completely removes any material adjustment that may // have been set via set_material() from this particular // node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_material() { nassertv_always(!is_empty()); node()->clear_attrib(MaterialAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_material +// Function: NodePath::has_material // Access: Published // Description: Returns true if a material has been applied to this // particular node via set_material(), false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_material() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1710,7 +1710,7 @@ has_material() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_material +// Function: NodePath::get_material // Access: Published // Description: Returns the material that has been set on this // particular node, or NULL if no material has been set. @@ -1723,7 +1723,7 @@ has_material() const { // to allow changes, if desired. Once changes are made, // they should be reapplied via set_material(). //////////////////////////////////////////////////////////////////// -PT(Material) qpNodePath:: +PT(Material) NodePath:: get_material() const { nassertr_always(!is_empty(), NULL); const RenderAttrib *attrib = @@ -1737,19 +1737,19 @@ get_material() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_fog +// Function: NodePath::set_fog // Access: Published // Description: Sets the geometry at this level and below to render // using the indicated fog. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -set_fog(qpFog *fog, int priority) { +void NodePath:: +set_fog(Fog *fog, int priority) { nassertv_always(!is_empty()); node()->set_attrib(FogAttrib::make(fog), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_fog_off +// Function: NodePath::set_fog_off // Access: Published // Description: Sets the geometry at this level and below to render // using no fog. This is normally the default, but @@ -1758,14 +1758,14 @@ set_fog(qpFog *fog, int priority) { // priority, to override a set_fog() at a lower // level). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_fog_off(int priority) { nassertv_always(!is_empty()); node()->set_attrib(FogAttrib::make_off(), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_fog +// Function: NodePath::clear_fog // Access: Published // Description: Completely removes any fog adjustment that may // have been set via set_fog() or set_fog_off() @@ -1773,14 +1773,14 @@ set_fog_off(int priority) { // fogs might be otherwise affecting the geometry to // show instead. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_fog() { nassertv_always(!is_empty()); node()->clear_attrib(FogAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_fog +// Function: NodePath::has_fog // Access: Published // Description: Returns true if a fog has been applied to this // particular node via set_fog(), false otherwise. @@ -1789,7 +1789,7 @@ clear_fog() { // fog, as there may be a fog in effect from a higher or // lower level. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_fog() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1803,7 +1803,7 @@ has_fog() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_fog_off +// Function: NodePath::has_fog_off // Access: Published // Description: Returns true if a fog has been specifically // disabled on this particular node via @@ -1812,7 +1812,7 @@ has_fog() const { // node will be rendered unfogged, as there may be a // fog in effect from a higher or lower level. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_fog_off() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1826,7 +1826,7 @@ has_fog_off() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_fog +// Function: NodePath::get_fog // Access: Published // Description: Returns the fog that has been set on this // particular node, or NULL if no fog has been set. @@ -1835,7 +1835,7 @@ has_fog_off() const { // another fog at a higher or lower level may // override. //////////////////////////////////////////////////////////////////// -qpFog *qpNodePath:: +Fog *NodePath:: get_fog() const { nassertr_always(!is_empty(), NULL); const RenderAttrib *attrib = @@ -1849,60 +1849,60 @@ get_fog() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_render_mode_wireframe +// Function: NodePath::set_render_mode_wireframe // Access: Published // Description: Sets up the geometry at this level and below (unless // overridden) to render in wireframe mode. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_render_mode_wireframe(int priority) { nassertv_always(!is_empty()); node()->set_attrib(RenderModeAttrib::make(RenderModeAttrib::M_wireframe), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_render_mode_filled +// Function: NodePath::set_render_mode_filled // Access: Published // Description: Sets up the geometry at this level and below (unless // overridden) to render in filled (i.e. not wireframe) // mode. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_render_mode_filled(int priority) { nassertv_always(!is_empty()); node()->set_attrib(RenderModeAttrib::make(RenderModeAttrib::M_filled), priority); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_render_mode +// Function: NodePath::clear_render_mode // Access: Published // Description: Completely removes any render mode adjustment that // may have been set on this node via // set_render_mode_wireframe() or // set_render_mode_filled(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_render_mode() { nassertv_always(!is_empty()); node()->clear_attrib(RenderModeAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_render_mode +// Function: NodePath::has_render_mode // Access: Published // Description: Returns true if a render mode has been explicitly set // on this particular node via // set_render_mode_wireframe() or // set_render_mode_filled(), false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_render_mode() const { nassertr_always(!is_empty(), false); return node()->has_attrib(RenderModeAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_two_sided +// Function: NodePath::set_two_sided // Access: Published // Description: Specifically sets or disables two-sided rendering // mode on this particular node. If no other nodes @@ -1910,7 +1910,7 @@ has_render_mode() const { // drawn (in two-sided mode, true) or culled (in // one-sided mode, false). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_two_sided(bool two_sided, int priority) { nassertv_always(!is_empty()); @@ -1923,7 +1923,7 @@ set_two_sided(bool two_sided, int priority) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_two_sided +// Function: NodePath::clear_two_sided // Access: Published // Description: Completely removes any two-sided adjustment that // may have been set on this node via set_two_sided(). @@ -1933,14 +1933,14 @@ set_two_sided(bool two_sided, int priority) { // had set_two_sided() on it, or according to the // initial state otherwise. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_two_sided() { nassertv_always(!is_empty()); node()->clear_attrib(CullFaceAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_two_sided +// Function: NodePath::has_two_sided // Access: Published // Description: Returns true if a two-sided adjustment has been // explicitly set on this particular node via @@ -1948,14 +1948,14 @@ clear_two_sided() { // get_two_sided() may be called to determine which has // been set. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_two_sided() const { nassertr_always(!is_empty(), false); return node()->has_attrib(CullFaceAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_two_sided +// Function: NodePath::get_two_sided // Access: Published // Description: Returns true if two-sided rendering has been // specifically set on this node via set_two_sided(), or @@ -1965,7 +1965,7 @@ has_two_sided() const { // imply that the geometry will or will not be rendered // two-sided, as there may be other nodes that override. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: get_two_sided() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -1979,7 +1979,7 @@ get_two_sided() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_depth_test +// Function: NodePath::set_depth_test // Access: Published // Description: Specifically sets or disables the testing of the // depth buffer on this particular node. This is @@ -1987,7 +1987,7 @@ get_two_sided() const { // scene graph; it should be on for rendering most 3-d // objects properly. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_depth_test(bool depth_test, int priority) { nassertv_always(!is_empty()); @@ -2000,19 +2000,19 @@ set_depth_test(bool depth_test, int priority) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_depth_test +// Function: NodePath::clear_depth_test // Access: Published // Description: Completely removes any depth-test adjustment that // may have been set on this node via set_depth_test(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_depth_test() { nassertv_always(!is_empty()); node()->clear_attrib(DepthTestAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_depth_test +// Function: NodePath::has_depth_test // Access: Published // Description: Returns true if a depth-test adjustment has been // explicitly set on this particular node via @@ -2020,14 +2020,14 @@ clear_depth_test() { // get_depth_test() may be called to determine which has // been set. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_depth_test() const { nassertr_always(!is_empty(), false); return node()->has_attrib(DepthTestAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_depth_test +// Function: NodePath::get_depth_test // Access: Published // Description: Returns true if depth-test rendering has been // specifically set on this node via set_depth_test(), or @@ -2035,7 +2035,7 @@ has_depth_test() const { // disabled, or if nothing has been specifically set. See // also has_depth_test(). //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: get_depth_test() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -2049,7 +2049,7 @@ get_depth_test() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_depth_write +// Function: NodePath::set_depth_write // Access: Published // Description: Specifically sets or disables the writing to the // depth buffer on this particular node. This is @@ -2057,7 +2057,7 @@ get_depth_test() const { // scene graph; it should be on for rendering most 3-d // objects properly. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_depth_write(bool depth_write, int priority) { nassertv_always(!is_empty()); @@ -2070,19 +2070,19 @@ set_depth_write(bool depth_write, int priority) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_depth_write +// Function: NodePath::clear_depth_write // Access: Published // Description: Completely removes any depth-write adjustment that // may have been set on this node via set_depth_write(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_depth_write() { nassertv_always(!is_empty()); node()->clear_attrib(DepthWriteAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_depth_write +// Function: NodePath::has_depth_write // Access: Published // Description: Returns true if a depth-write adjustment has been // explicitly set on this particular node via @@ -2090,14 +2090,14 @@ clear_depth_write() { // get_depth_write() may be called to determine which has // been set. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_depth_write() const { nassertr_always(!is_empty(), false); return node()->has_attrib(DepthWriteAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_depth_write +// Function: NodePath::get_depth_write // Access: Published // Description: Returns true if depth-write rendering has been // specifically set on this node via set_depth_write(), or @@ -2105,7 +2105,7 @@ has_depth_write() const { // disabled, or if nothing has been specifically set. See // also has_depth_write(). //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: get_depth_write() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -2119,7 +2119,7 @@ get_depth_write() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::do_billboard_axis +// Function: NodePath::do_billboard_axis // Access: Published // Description: Performs a billboard-type rotate to the indicated // camera node, one time only, and leaves the object @@ -2127,11 +2127,11 @@ get_depth_write() const { // However, it does lose both translate and scale // components of the matrix. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -do_billboard_axis(const qpNodePath &camera, float offset) { +void NodePath:: +do_billboard_axis(const NodePath &camera, float offset) { nassertv_always(!is_empty()); - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); LMatrix4f rel_mat = camera.get_mat(parent); LVector3f up = LVector3f::up(); @@ -2153,7 +2153,7 @@ do_billboard_axis(const qpNodePath &camera, float offset) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::do_billboard_point_eye +// Function: NodePath::do_billboard_point_eye // Access: Published // Description: Performs a billboard-type rotate to the indicated // camera node, one time only, and leaves the object @@ -2161,11 +2161,11 @@ do_billboard_axis(const qpNodePath &camera, float offset) { // although the point_eye billboard effect cannot be // achieved using the ordinary look_at() call. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -do_billboard_point_eye(const qpNodePath &camera, float offset) { +void NodePath:: +do_billboard_point_eye(const NodePath &camera, float offset) { nassertv_always(!is_empty()); - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); LMatrix4f rel_mat = camera.get_mat(parent); LVector3f up = LVector3f::up() * rel_mat; @@ -2187,17 +2187,17 @@ do_billboard_point_eye(const qpNodePath &camera, float offset) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::do_billboard_point_world +// Function: NodePath::do_billboard_point_world // Access: Published // Description: Performs a billboard-type rotate to the indicated // camera node, one time only, and leaves the object // rotated. This is similar in principle to look_at(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: -do_billboard_point_world(const qpNodePath &camera, float offset) { +void NodePath:: +do_billboard_point_world(const NodePath &camera, float offset) { nassertv_always(!is_empty()); - qpNodePath parent = get_parent(); + NodePath parent = get_parent(); LMatrix4f rel_mat = camera.get_mat(parent); LVector3f up = LVector3f::up(); @@ -2219,85 +2219,85 @@ do_billboard_point_world(const qpNodePath &camera, float offset) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_billboard_axis +// Function: NodePath::set_billboard_axis // Access: Published // Description: Puts a billboard transition on the node such that it // will rotate in two dimensions around the up axis. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_billboard_axis(float offset) { nassertv_always(!is_empty()); CPT(RenderEffect) billboard = BillboardEffect::make (LVector3f::up(), false, true, - offset, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + offset, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); node()->set_effect(billboard); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_billboard_point_eye +// Function: NodePath::set_billboard_point_eye // Access: Published // Description: Puts a billboard transition on the node such that it // will rotate in three dimensions about the origin, // keeping its up vector oriented to the top of the // camera. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_billboard_point_eye(float offset) { nassertv_always(!is_empty()); CPT(RenderEffect) billboard = BillboardEffect::make (LVector3f::up(), true, false, - offset, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + offset, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); node()->set_effect(billboard); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_billboard_point_world +// Function: NodePath::set_billboard_point_world // Access: Published // Description: Puts a billboard transition on the node such that it // will rotate in three dimensions about the origin, // keeping its up vector oriented to the sky. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_billboard_point_world(float offset) { nassertv_always(!is_empty()); CPT(RenderEffect) billboard = BillboardEffect::make (LVector3f::up(), false, false, - offset, qpNodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); + offset, NodePath(), LPoint3f(0.0f, 0.0f, 0.0f)); node()->set_effect(billboard); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_billboard +// Function: NodePath::clear_billboard // Access: Published // Description: Removes any billboard effect from the node. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_billboard() { nassertv_always(!is_empty()); node()->clear_effect(BillboardEffect::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_billboard +// Function: NodePath::has_billboard // Access: Published // Description: Returns true if there is any billboard effect on // the node. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_billboard() const { nassertr_always(!is_empty(), false); return node()->has_effect(BillboardEffect::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::set_transparency +// Function: NodePath::set_transparency // Access: Published // Description: Specifically sets or disables transparent rendering // mode on this particular node. If no other nodes // override, this will cause items with a non-1 value // for alpha color to be rendered partially transparent. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: set_transparency(bool transparency, int priority) { nassertv_always(!is_empty()); @@ -2310,7 +2310,7 @@ set_transparency(bool transparency, int priority) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::clear_transparency +// Function: NodePath::clear_transparency // Access: Published // Description: Completely removes any transparency adjustment that // may have been set on this node via set_transparency(). @@ -2319,14 +2319,14 @@ set_transparency(bool transparency, int priority) { // to whatever other nodes may have had // set_transparency() on them. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: clear_transparency() { nassertv_always(!is_empty()); node()->clear_attrib(TransparencyAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::has_transparency +// Function: NodePath::has_transparency // Access: Published // Description: Returns true if a transparent-rendering adjustment // has been explicitly set on this particular node via @@ -2335,14 +2335,14 @@ clear_transparency() { // transparency has been explicitly enabled or // explicitly disabled for this node. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: has_transparency() const { nassertr_always(!is_empty(), false); return node()->has_attrib(TransparencyAttrib::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_transparency +// Function: NodePath::get_transparency // Access: Published // Description: Returns true if transparent rendering has been // specifically set on this node via set_transparency(), or @@ -2352,7 +2352,7 @@ has_transparency() const { // imply that the geometry will or will not be rendered // transparent, as there may be other nodes that override. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: get_transparency() const { nassertr_always(!is_empty(), false); const RenderAttrib *attrib = @@ -2367,22 +2367,22 @@ get_transparency() const { //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_hidden_ancestor +// Function: NodePath::get_hidden_ancestor // Access: Published // Description: Returns the NodePath at or above the referenced node // that is hidden to the indicated camera(s), or an // empty NodePath if no ancestor of the referenced node // is hidden (and the node should be visible). //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: +NodePath NodePath:: get_hidden_ancestor(DrawMask camera_mask) const { - qpNodePathComponent *comp; + NodePathComponent *comp; for (comp = _head; - comp != (qpNodePathComponent *)NULL; + comp != (NodePathComponent *)NULL; comp = comp->get_next()) { PandaNode *node = comp->get_node(); if ((node->get_draw_mask() & camera_mask).is_zero()) { - qpNodePath result; + NodePath result; result._head = comp; return result; } @@ -2392,25 +2392,25 @@ get_hidden_ancestor(DrawMask camera_mask) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_stashed_ancestor +// Function: NodePath::get_stashed_ancestor // Access: Published // Description: Returns the NodePath at or above the referenced node // that is stashed, or an empty NodePath if no ancestor // of the referenced node is stashed (and the node should // be visible). //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePath:: +NodePath NodePath:: get_stashed_ancestor() const { - qpNodePathComponent *comp = _head; - if (comp != (qpNodePathComponent *)NULL) { - qpNodePathComponent *next = comp->get_next(); + NodePathComponent *comp = _head; + if (comp != (NodePathComponent *)NULL) { + NodePathComponent *next = comp->get_next(); - while (next != (qpNodePathComponent *)NULL) { + while (next != (NodePathComponent *)NULL) { PandaNode *node = comp->get_node(); PandaNode *parent_node = next->get_node(); if (parent_node->find_stashed(node) >= 0) { - qpNodePath result; + NodePath result; result._head = comp; return result; } @@ -2424,21 +2424,21 @@ get_stashed_ancestor() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::verify_complete +// Function: NodePath::verify_complete // Access: Published // Description: Returns true if all of the nodes described in the -// qpNodePath are connected and the top node is the top +// NodePath are connected and the top node is the top // of the graph, or false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: verify_complete() const { if (is_empty()) { return true; } uncollapse_head(); - const qpNodePathComponent *comp = _head; - nassertr(comp != (const qpNodePathComponent *)NULL, false); + const NodePathComponent *comp = _head; + nassertr(comp != (const NodePathComponent *)NULL, false); PandaNode *node = comp->get_node(); nassertr(node != (const PandaNode *)NULL, false); @@ -2446,7 +2446,7 @@ verify_complete() const { comp = comp->get_next(); length--; - while (comp != (const qpNodePathComponent *)NULL) { + while (comp != (const NodePathComponent *)NULL) { PandaNode *next_node = comp->get_node(); nassertr(next_node != (const PandaNode *)NULL, false); @@ -2482,7 +2482,7 @@ verify_complete() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::prepare_scene +// Function: NodePath::prepare_scene // Access: Published // Description: Walks through the scene graph beginning at the bottom // node, and does whatever initialization is required to @@ -2498,7 +2498,7 @@ verify_complete() const { // Otherwise, retained mode is set only if the // retained-mode Config variable is true. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: prepare_scene(GraphicsStateGuardianBase *gsg, bool force_retained_mode) { nassertv_always(!is_empty()); @@ -2508,7 +2508,7 @@ prepare_scene(GraphicsStateGuardianBase *gsg, bool force_retained_mode) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::show_bounds +// Function: NodePath::show_bounds // Access: Published // Description: Causes the bounding volume of the bottom node and all // of its descendants (that is, the bounding volume @@ -2516,40 +2516,40 @@ prepare_scene(GraphicsStateGuardianBase *gsg, bool force_retained_mode) { // if possible. The rendering method is less than // optimal; this is intended primarily for debugging. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: show_bounds() { nassertv_always(!is_empty()); node()->set_effect(ShowBoundsEffect::make()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::hide_bounds +// Function: NodePath::hide_bounds // Access: Published // Description: Stops the rendering of the bounding volume begun with // show_bounds(). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: hide_bounds() { nassertv_always(!is_empty()); node()->clear_effect(ShowBoundsEffect::get_class_type()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::get_bounds +// Function: NodePath::get_bounds // Access: Published // Description: Returns a newly-allocated bounding volume containing // the bottom node and all of its descendants. This is // the bounding volume on the bottom arc, converted to // the local coordinate space of the node. //////////////////////////////////////////////////////////////////// -PT(BoundingVolume) qpNodePath:: +PT(BoundingVolume) NodePath:: get_bounds() const { nassertr_always(!is_empty(), new BoundingSphere); return node()->get_bound().make_copy(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::force_recompute_bounds +// Function: NodePath::force_recompute_bounds // Access: Published // Description: Forces the recomputing of all the bounding volumes at // every node in the subgraph beginning at this node and @@ -2564,29 +2564,29 @@ get_bounds() const { // volumes (which does not presently happen // automatically). //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: force_recompute_bounds() { nassertv_always(!is_empty()); r_force_recompute_bounds(node()); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::write_bounds +// Function: NodePath::write_bounds // Access: Published // Description: Writes a description of the bounding volume // containing the bottom node and all of its descendants // to the indicated output stream. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: write_bounds(ostream &out) const { get_bounds()->write(out); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::calc_tight_bounds +// Function: NodePath::calc_tight_bounds // Access: Published // Description: Calculates the minimum and maximum vertices of all -// Geoms at this qpNodePath's bottom node and below. This +// Geoms at this NodePath's bottom node and below. This // is a tight bounding box; it will generally be tighter // than the bounding volume returned by get_bounds() // (but it is more expensive to compute). @@ -2594,7 +2594,7 @@ write_bounds(ostream &out) const { // The return value is true if any points are within the // bounding volume, or false if none are. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point) { min_point.set(0.0f, 0.0f, 0.0f); max_point.set(0.0f, 0.0f, 0.0f); @@ -2608,7 +2608,7 @@ calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::flatten_light +// Function: NodePath::flatten_light // Access: Published // Description: Lightly flattens out the hierarchy below this node by // applying transforms, colors, and texture matrices @@ -2620,7 +2620,7 @@ calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point) { // resulting scene graph, but the number of nodes will // remain the same. // -// Particularly, any qpNodePaths that reference nodes +// Particularly, any NodePaths that reference nodes // within this hierarchy will not be damaged. However, // since this operation will remove transforms from the // scene graph, it may be dangerous to apply to arcs @@ -2631,17 +2631,17 @@ calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point) { // The return value is always 0, since flatten_light // does not remove any arcs. //////////////////////////////////////////////////////////////////// -int qpNodePath:: +int NodePath:: flatten_light() { nassertr_always(!is_empty(), 0); - qpSceneGraphReducer gr; + SceneGraphReducer gr; gr.apply_attribs(node()); return 0; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::flatten_medium +// Function: NodePath::flatten_medium // Access: Published // Description: A more thorough flattening than flatten_light(), this // first applies all the transforms, colors, and texture @@ -2664,10 +2664,10 @@ flatten_light() { // // The return value is the number of arcs removed. //////////////////////////////////////////////////////////////////// -int qpNodePath:: +int NodePath:: flatten_medium() { nassertr_always(!is_empty(), 0); - qpSceneGraphReducer gr; + SceneGraphReducer gr; gr.apply_attribs(node()); int num_removed = gr.flatten(node(), false); @@ -2675,7 +2675,7 @@ flatten_medium() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::flatten_strong +// Function: NodePath::flatten_strong // Access: Published // Description: The strongest possible flattening. This first // applies all of the transforms to the vertices, as in @@ -2691,10 +2691,10 @@ flatten_medium() { // entire scene may result in overall poorer performance // because of less-effective culling. //////////////////////////////////////////////////////////////////// -int qpNodePath:: +int NodePath:: flatten_strong() { nassertr_always(!is_empty(), 0); - qpSceneGraphReducer gr; + SceneGraphReducer gr; gr.apply_attribs(node()); int num_removed = gr.flatten(node(), true); @@ -2702,7 +2702,7 @@ flatten_strong() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::write_bam_file +// Function: NodePath::write_bam_file // Access: Published // Description: Writes the contents of this node and below out to a // bam file with the indicated filename. This file may @@ -2710,7 +2710,7 @@ flatten_strong() { // Returns true if successful, false on some kind of // error. //////////////////////////////////////////////////////////////////// -bool qpNodePath:: +bool NodePath:: write_bam_file(const string &filename) const { nassertr_always(!is_empty(), false); @@ -2735,7 +2735,7 @@ write_bam_file(const string &filename) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::uncollapse_head +// Function: NodePath::uncollapse_head // Access: Private // Description: Quietly and transparently uncollapses the _head // pointer if it needs it. This can happen only when @@ -2743,41 +2743,41 @@ write_bam_file(const string &filename) const { // path after the removal of an instance somewhere // higher up the chain. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: uncollapse_head() const { - if (_head != (qpNodePathComponent *)NULL && _head->is_collapsed()) { - ((qpNodePath *)this)->_head = _head->uncollapse(); + if (_head != (NodePathComponent *)NULL && _head->is_collapsed()) { + ((NodePath *)this)->_head = _head->uncollapse(); } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_common_ancestor +// Function: NodePath::find_common_ancestor // Access: Private, Static -// Description: Walks up from both qpNodePaths to find the first node +// Description: Walks up from both NodePaths to find the first node // that both have in common, if any. Fills a_count and // b_count with the number of nodes below the common // node in each path. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -find_common_ancestor(const qpNodePath &a, const qpNodePath &b, +void NodePath:: +find_common_ancestor(const NodePath &a, const NodePath &b, int &a_count, int &b_count) { nassertv(!a.is_empty() && !b.is_empty()); a.uncollapse_head(); b.uncollapse_head(); - qpNodePathComponent *ac = a._head; - qpNodePathComponent *bc = b._head; + NodePathComponent *ac = a._head; + NodePathComponent *bc = b._head; a_count = 0; b_count = 0; // Shorten up the longer one until they are the same length. while (ac->get_length() > bc->get_length()) { - nassertv(ac != (qpNodePathComponent *)NULL); + nassertv(ac != (NodePathComponent *)NULL); ac = ac->get_next(); a_count++; } while (bc->get_length() > ac->get_length()) { - nassertv(bc != (qpNodePathComponent *)NULL); + nassertv(bc != (NodePathComponent *)NULL); bc = bc->get_next(); b_count++; } @@ -2785,8 +2785,8 @@ find_common_ancestor(const qpNodePath &a, const qpNodePath &b, // Now shorten them both up until we reach the same component. while (ac != bc) { // These shouldn't go to NULL unless they both go there together. - nassertv(ac != (qpNodePathComponent *)NULL); - nassertv(bc != (qpNodePathComponent *)NULL); + nassertv(ac != (NodePathComponent *)NULL); + nassertv(bc != (NodePathComponent *)NULL); ac = ac->get_next(); a_count++; bc = bc->get_next(); @@ -2795,14 +2795,14 @@ find_common_ancestor(const qpNodePath &a, const qpNodePath &b, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_get_net_state +// Function: NodePath::r_get_net_state // Access: Private // Description: Recursively determines the net state chnages to the // indicated component node from the root of the graph. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpNodePath:: -r_get_net_state(qpNodePathComponent *comp) const { - if (comp == (qpNodePathComponent *)NULL) { +CPT(RenderState) NodePath:: +r_get_net_state(NodePathComponent *comp) const { + if (comp == (NodePathComponent *)NULL) { return RenderState::make_empty(); } else { CPT(RenderState) state = comp->get_node()->get_state(); @@ -2811,16 +2811,16 @@ r_get_net_state(qpNodePathComponent *comp) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_get_partial_state +// Function: NodePath::r_get_partial_state // Access: Private // Description: Recursively determines the net state changes to the // indicated component node from the nth node above it. // If n exceeds the length of the path, this returns the // net transform from the root of the graph. //////////////////////////////////////////////////////////////////// -CPT(RenderState) qpNodePath:: -r_get_partial_state(qpNodePathComponent *comp, int n) const { - if (n == 0 || comp == (qpNodePathComponent *)NULL) { +CPT(RenderState) NodePath:: +r_get_partial_state(NodePathComponent *comp, int n) const { + if (n == 0 || comp == (NodePathComponent *)NULL) { return RenderState::make_empty(); } else { CPT(RenderState) state = comp->get_node()->get_state(); @@ -2829,14 +2829,14 @@ r_get_partial_state(qpNodePathComponent *comp, int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_get_net_transform +// Function: NodePath::r_get_net_transform // Access: Private // Description: Recursively determines the net transform to the // indicated component node from the root of the graph. //////////////////////////////////////////////////////////////////// -CPT(TransformState) qpNodePath:: -r_get_net_transform(qpNodePathComponent *comp) const { - if (comp == (qpNodePathComponent *)NULL) { +CPT(TransformState) NodePath:: +r_get_net_transform(NodePathComponent *comp) const { + if (comp == (NodePathComponent *)NULL) { return TransformState::make_identity(); } else { CPT(TransformState) transform = comp->get_node()->get_transform(); @@ -2845,16 +2845,16 @@ r_get_net_transform(qpNodePathComponent *comp) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_get_partial_transform +// Function: NodePath::r_get_partial_transform // Access: Private // Description: Recursively determines the net transform to the // indicated component node from the nth node above it. // If n exceeds the length of the path, this returns the // net transform from the root of the graph. //////////////////////////////////////////////////////////////////// -CPT(TransformState) qpNodePath:: -r_get_partial_transform(qpNodePathComponent *comp, int n) const { - if (n == 0 || comp == (qpNodePathComponent *)NULL) { +CPT(TransformState) NodePath:: +r_get_partial_transform(NodePathComponent *comp, int n) const { + if (n == 0 || comp == (NodePathComponent *)NULL) { return TransformState::make_identity(); } else { CPT(TransformState) transform = comp->get_node()->get_transform(); @@ -2863,18 +2863,18 @@ r_get_partial_transform(qpNodePathComponent *comp, int n) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_output +// Function: NodePath::r_output // Access: Private // Description: The recursive implementation of output(), this writes // the names of each node component in order from // beginning to end, by first walking to the end of the // linked list and then outputting from there. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -r_output(ostream &out, qpNodePathComponent *comp) const { +void NodePath:: +r_output(ostream &out, NodePathComponent *comp) const { PandaNode *node = comp->get_node(); - qpNodePathComponent *next = comp->get_next(); - if (next != (qpNodePathComponent *)NULL) { + NodePathComponent *next = comp->get_next(); + if (next != (NodePathComponent *)NULL) { // This is not the head of the list; keep going up. r_output(out, next); out << "/"; @@ -2900,7 +2900,7 @@ r_output(ostream &out, qpNodePathComponent *comp) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_matches +// Function: NodePath::find_matches // Access: Private // Description: Finds up to max_matches matches against the given // path string from this node and deeper. The @@ -2908,23 +2908,23 @@ r_output(ostream &out, qpNodePathComponent *comp) const { // matches to return, or -1 not to limit the number // returned. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -find_matches(qpNodePathCollection &result, const string &path, +void NodePath:: +find_matches(NodePathCollection &result, const string &path, int max_matches) const { if (is_empty()) { pgraph_cat.warning() - << "Attempt to extend an empty qpNodePath by '" << path + << "Attempt to extend an empty NodePath by '" << path << "'.\n"; return; } - qpFindApproxPath approx_path; + FindApproxPath approx_path; if (approx_path.add_string(path)) { find_matches(result, approx_path, max_matches); } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::find_matches +// Function: NodePath::find_matches // Access: Private // Description: Finds up to max_matches matches against the given // approx_path from this node and deeper. The @@ -2932,28 +2932,28 @@ find_matches(qpNodePathCollection &result, const string &path, // matches to return, or -1 not to limit the number // returned. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -find_matches(qpNodePathCollection &result, qpFindApproxPath &approx_path, +void NodePath:: +find_matches(NodePathCollection &result, FindApproxPath &approx_path, int max_matches) const { if (is_empty()) { pgraph_cat.warning() - << "Attempt to extend an empty qpNodePath by: " << approx_path << ".\n"; + << "Attempt to extend an empty NodePath by: " << approx_path << ".\n"; return; } - qpFindApproxLevelEntry start(*this, approx_path); - qpFindApproxLevel level; + FindApproxLevelEntry start(*this, approx_path); + FindApproxLevel level; level.add_entry(start); r_find_matches(result, level, max_matches, _max_search_depth); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_find_matches +// Function: NodePath::r_find_matches // Access: Private // Description: The recursive implementation of find_matches. //////////////////////////////////////////////////////////////////// -void qpNodePath:: -r_find_matches(qpNodePathCollection &result, - const qpFindApproxLevel &level, +void NodePath:: +r_find_matches(NodePathCollection &result, + const FindApproxLevel &level, int max_matches, int num_levels_remaining) const { // Go on to the next level. If we exceeded the requested maximum // depth, stop. @@ -2962,14 +2962,14 @@ r_find_matches(qpNodePathCollection &result, } num_levels_remaining--; - qpFindApproxLevel next_level; + FindApproxLevel next_level; bool okflag = true; // For each node in the current level, build up the set of possible // matches in the next level. - qpFindApproxLevel::Vec::const_iterator li; + FindApproxLevel::Vec::const_iterator li; for (li = level._v.begin(); li != level._v.end() && okflag; ++li) { - const qpFindApproxLevelEntry &entry = (*li); + const FindApproxLevelEntry &entry = (*li); if (entry.is_solution()) { // Does this entry already represent a solution? @@ -2994,17 +2994,17 @@ r_find_matches(qpNodePathCollection &result, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_adjust_all_priorities +// Function: NodePath::r_adjust_all_priorities // Access: Private // Description: The recursive implementation of // adjust_all_priorities(). This walks through the // subgraph defined by the indicated node and below. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: r_adjust_all_priorities(PandaNode *node, int adjustment) { node->set_state(node->get_state()->adjust_all_priorities(adjustment)); if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); int num_geoms = gnode->get_num_geoms(); @@ -3021,14 +3021,14 @@ r_adjust_all_priorities(PandaNode *node, int adjustment) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_force_recompute_bounds +// Function: NodePath::r_force_recompute_bounds // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: r_force_recompute_bounds(PandaNode *node) { if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); int num_geoms = gnode->get_num_geoms(); @@ -3048,17 +3048,17 @@ r_force_recompute_bounds(PandaNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_calc_tight_bounds +// Function: NodePath::r_calc_tight_bounds // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: r_calc_tight_bounds(PandaNode *node, LPoint3f &min_point, LPoint3f &max_point, bool &found_any, const TransformState *transform) { CPT(TransformState) next_transform = transform->compose(node->get_transform()); if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); const LMatrix4f &mat = next_transform->get_mat(); @@ -3100,15 +3100,15 @@ r_calc_tight_bounds(PandaNode *node, LPoint3f &min_point, LPoint3f &max_point, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_find_texture +// Function: NodePath::r_find_texture // Access: Private // Description: //////////////////////////////////////////////////////////////////// -Texture * qpNodePath:: +Texture * NodePath:: r_find_texture(PandaNode *node, const RenderState *state, const GlobPattern &glob) const { if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_R(gnode, node, NULL); int num_geoms = gnode->get_num_geoms(); @@ -3148,15 +3148,15 @@ r_find_texture(PandaNode *node, const RenderState *state, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_find_all_textures +// Function: NodePath::r_find_all_textures // Access: Private // Description: //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: r_find_all_textures(PandaNode *node, const RenderState *state, - qpNodePath::Textures &textures) const { + NodePath::Textures &textures) const { if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); int num_geoms = gnode->get_num_geoms(); @@ -3188,15 +3188,15 @@ r_find_all_textures(PandaNode *node, const RenderState *state, } //////////////////////////////////////////////////////////////////// -// Function: qpNodePath::r_prepare_scene +// Function: NodePath::r_prepare_scene // Access: Private // Description: The recursive implementation of prepare_scene. //////////////////////////////////////////////////////////////////// -void qpNodePath:: +void NodePath:: r_prepare_scene(PandaNode *node, const RenderState *state, GraphicsStateGuardianBase *gsg, bool do_retained_mode) { if (node->is_geom_node()) { - qpGeomNode *gnode; + GeomNode *gnode; DCAST_INTO_V(gnode, node); /* diff --git a/panda/src/pgraph/qpnodePath.h b/panda/src/pgraph/nodePath.h similarity index 72% rename from panda/src/pgraph/qpnodePath.h rename to panda/src/pgraph/nodePath.h index ebb0fbcf5d..5c812e4ddb 100644 --- a/panda/src/pgraph/qpnodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -1,4 +1,4 @@ -// Filename: qpnodePath.h +// Filename: nodePath.h // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,28 +16,28 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpNODEPATH_H -#define qpNODEPATH_H +#ifndef NODEPATH_H +#define NODEPATH_H #include "pandabase.h" #include "pandaNode.h" #include "renderState.h" #include "transformState.h" -#include "qpnodePathComponent.h" +#include "nodePathComponent.h" #include "pointerTo.h" #include "referenceCount.h" #include "notify.h" #include "typedObject.h" -class qpNodePathCollection; +class NodePathCollection; class TextureCollection; -class qpFindApproxLevel; -class qpFindApproxPath; +class FindApproxLevel; +class FindApproxPath; class Texture; class Material; -class qpFog; +class Fog; class GlobPattern; // @@ -133,37 +133,37 @@ class GlobPattern; // the NodePath will automatically be updated to reflect // the changes. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpNodePath { +class EXPCL_PANDA NodePath { PUBLISHED: // This enumeration is returned by get_error_type() for an empty - // qpNodePath to report the reason it's empty. + // NodePath to report the reason it's empty. enum ErrorType { ET_ok = 0, // i.e. not empty, or never assigned to anything. ET_not_found, // returned from a failed find() or similar function. - ET_removed, // remove_node() was previously called on this qpNodePath. + ET_removed, // remove_node() was previously called on this NodePath. ET_fail, // general failure return from some function. - // Also see qpNodePathComponent::_next_key, which initializes + // Also see NodePathComponent::_next_key, which initializes // itself to the last enumerated type here plus one. }; - INLINE qpNodePath(); - INLINE qpNodePath(const string &top_node_name); - INLINE qpNodePath(PandaNode *node); - INLINE static qpNodePath any_path(PandaNode *node); - INLINE qpNodePath(const qpNodePath &parent, PandaNode *child_node); + INLINE NodePath(); + INLINE NodePath(const string &top_node_name); + INLINE NodePath(PandaNode *node); + INLINE static NodePath any_path(PandaNode *node); + INLINE NodePath(const NodePath &parent, PandaNode *child_node); - INLINE qpNodePath(const qpNodePath ©); - INLINE void operator = (const qpNodePath ©); + INLINE NodePath(const NodePath ©); + INLINE void operator = (const NodePath ©); - INLINE static qpNodePath not_found(); - INLINE static qpNodePath removed(); - INLINE static qpNodePath fail(); + INLINE static NodePath not_found(); + INLINE static NodePath removed(); + INLINE static NodePath fail(); INLINE static void set_max_search_depth(int max_search_depth); INLINE static int get_max_search_depth(); - // Methods to query a qpNodePath's contents. + // Methods to query a NodePath's contents. INLINE bool is_empty() const; INLINE bool is_singleton() const; int get_num_nodes() const; @@ -179,31 +179,31 @@ PUBLISHED: // Methods that return collections of NodePaths derived from or // related to this one. - qpNodePathCollection get_children() const; + NodePathCollection get_children() const; INLINE int get_num_children() const; - INLINE qpNodePath get_child(int n) const; + INLINE NodePath get_child(int n) const; INLINE bool has_parent() const; - INLINE qpNodePath get_parent() const; + INLINE NodePath get_parent() const; - qpNodePath find(const string &path) const; - qpNodePath find_path_to(PandaNode *node) const; - qpNodePathCollection find_all_matches(const string &path) const; - qpNodePathCollection find_all_paths_to(PandaNode *node) const; + NodePath find(const string &path) const; + NodePath find_path_to(PandaNode *node) const; + NodePathCollection find_all_matches(const string &path) const; + NodePathCollection find_all_paths_to(PandaNode *node) const; // Methods that actually move nodes around in the scene graph. The // optional "sort" parameter can be used to force a particular // ordering between sibling nodes, useful when dealing with LOD's // and similar switch nodes. If the sort value is the same, nodes // will be arranged in the order they were added. - void reparent_to(const qpNodePath &other, int sort = 0); - void wrt_reparent_to(const qpNodePath &other, int sort = 0); - qpNodePath instance_to(const qpNodePath &other, int sort = 0) const; - qpNodePath instance_under_node(const qpNodePath &other, const string &name, + void reparent_to(const NodePath &other, int sort = 0); + void wrt_reparent_to(const NodePath &other, int sort = 0); + NodePath instance_to(const NodePath &other, int sort = 0) const; + NodePath instance_under_node(const NodePath &other, const string &name, int sort = 0) const; - qpNodePath copy_to(const qpNodePath &other, int sort = 0) const; - qpNodePath attach_new_node(PandaNode *node, int sort = 0) const; - INLINE qpNodePath attach_new_node(const string &name, int sort = 0) const; + NodePath copy_to(const NodePath &other, int sort = 0) const; + NodePath attach_new_node(PandaNode *node, int sort = 0) const; + INLINE NodePath attach_new_node(const string &name, int sort = 0) const; void remove_node(); void detach_node(); @@ -219,14 +219,14 @@ PUBLISHED: // Aggregate transform and state information. INLINE const RenderState *get_state() const; INLINE void set_state(const RenderState *state) const; - CPT(RenderState) get_state(const qpNodePath &other) const; - void set_state(const qpNodePath &other, const RenderState *state) const; + CPT(RenderState) get_state(const NodePath &other) const; + void set_state(const NodePath &other, const RenderState *state) const; INLINE CPT(RenderState) get_net_state() const; INLINE const TransformState *get_transform() const; INLINE void set_transform(const TransformState *transform) const; - CPT(TransformState) get_transform(const qpNodePath &other) const; - void set_transform(const qpNodePath &other, const TransformState *transform) const; + CPT(TransformState) get_transform(const NodePath &other) const; + void set_transform(const NodePath &other, const TransformState *transform) const; INLINE CPT(TransformState) get_net_transform() const; @@ -309,75 +309,75 @@ PUBLISHED: // Methods that get and set the matrix transforms relative to some // other node in the scene graph. These perform an implicit wrt(). - INLINE void set_pos(const qpNodePath &other, float x, float y, float z); - void set_pos(const qpNodePath &other, const LVecBase3f &pos); - void set_x(const qpNodePath &other, float x); - void set_y(const qpNodePath &other, float y); - void set_z(const qpNodePath &other, float z); - LPoint3f get_pos(const qpNodePath &other) const; - INLINE float get_x(const qpNodePath &other) const; - INLINE float get_y(const qpNodePath &other) const; - INLINE float get_z(const qpNodePath &other) const; + INLINE void set_pos(const NodePath &other, float x, float y, float z); + void set_pos(const NodePath &other, const LVecBase3f &pos); + void set_x(const NodePath &other, float x); + void set_y(const NodePath &other, float y); + void set_z(const NodePath &other, float z); + LPoint3f get_pos(const NodePath &other) const; + INLINE float get_x(const NodePath &other) const; + INLINE float get_y(const NodePath &other) const; + INLINE float get_z(const NodePath &other) const; - INLINE void set_hpr(const qpNodePath &other, float h, float p, float r); - void set_hpr(const qpNodePath &other, const LVecBase3f &hpr); - void set_h(const qpNodePath &other, float h); - void set_p(const qpNodePath &other, float p); - void set_r(const qpNodePath &other, float r); - LVecBase3f get_hpr(const qpNodePath &other) const; - LVecBase3f get_hpr(const qpNodePath &other, float roll) const; - INLINE float get_h(const qpNodePath &other) const; - INLINE float get_p(const qpNodePath &other) const; - INLINE float get_r(const qpNodePath &other) const; + INLINE void set_hpr(const NodePath &other, float h, float p, float r); + void set_hpr(const NodePath &other, const LVecBase3f &hpr); + void set_h(const NodePath &other, float h); + void set_p(const NodePath &other, float p); + void set_r(const NodePath &other, float r); + LVecBase3f get_hpr(const NodePath &other) const; + LVecBase3f get_hpr(const NodePath &other, float roll) const; + INLINE float get_h(const NodePath &other) const; + INLINE float get_p(const NodePath &other) const; + INLINE float get_r(const NodePath &other) const; - INLINE void set_scale(const qpNodePath &other, float sx, float sy, float sz); - void set_scale(const qpNodePath &other, const LVecBase3f &scale); - void set_sx(const qpNodePath &other, float sx); - void set_sy(const qpNodePath &other, float sy); - void set_sz(const qpNodePath &other, float sz); - LVecBase3f get_scale(const qpNodePath &other) const; - INLINE float get_sx(const qpNodePath &other) const; - INLINE float get_sy(const qpNodePath &other) const; - INLINE float get_sz(const qpNodePath &other) const; + INLINE void set_scale(const NodePath &other, float sx, float sy, float sz); + void set_scale(const NodePath &other, const LVecBase3f &scale); + void set_sx(const NodePath &other, float sx); + void set_sy(const NodePath &other, float sy); + void set_sz(const NodePath &other, float sz); + LVecBase3f get_scale(const NodePath &other) const; + INLINE float get_sx(const NodePath &other) const; + INLINE float get_sy(const NodePath &other) const; + INLINE float get_sz(const NodePath &other) const; - INLINE void set_pos_hpr(const qpNodePath &other, + INLINE void set_pos_hpr(const NodePath &other, float x, float y, float z, float h, float p, float r); - void set_pos_hpr(const qpNodePath &other, + void set_pos_hpr(const NodePath &other, const LVecBase3f &pos, const LVecBase3f &hpr); - INLINE void set_hpr_scale(const qpNodePath &other, + INLINE void set_hpr_scale(const NodePath &other, float h, float p, float r, float sx, float sy, float sz); - void set_hpr_scale(const qpNodePath &other, + void set_hpr_scale(const NodePath &other, const LVecBase3f &hpr, const LVecBase3f &scale); - INLINE void set_pos_hpr_scale(const qpNodePath &other, + INLINE void set_pos_hpr_scale(const NodePath &other, float x, float y, float z, float h, float p, float r, float sx, float sy, float sz); - void set_pos_hpr_scale(const qpNodePath &other, + void set_pos_hpr_scale(const NodePath &other, const LVecBase3f &pos, const LVecBase3f &hpr, const LVecBase3f &scale); - const LMatrix4f &get_mat(const qpNodePath &other) const; - void set_mat(const qpNodePath &other, const LMatrix4f &mat); + const LMatrix4f &get_mat(const NodePath &other) const; + void set_mat(const NodePath &other, const LMatrix4f &mat); - LPoint3f get_relative_point(const qpNodePath &other, const LVecBase3f &point); + LPoint3f get_relative_point(const NodePath &other, const LVecBase3f &point); - INLINE void look_at(const qpNodePath &other, + INLINE void look_at(const NodePath &other, float x, float y, float z); - void look_at(const qpNodePath &other, + void look_at(const NodePath &other, const LPoint3f &point = LPoint3f(0.0, 0.0, 0.0), const LVector3f &up = LVector3f::up()); - INLINE void heads_up(const qpNodePath &other, + INLINE void heads_up(const NodePath &other, float x, float y, float z); - void heads_up(const qpNodePath &other, + void heads_up(const NodePath &other, const LPoint3f &point = LPoint3f(0.0, 0.0, 0.0), const LVector3f &up = LVector3f::up()); - INLINE float get_distance(const qpNodePath &other) const; + INLINE float get_distance(const NodePath &other) const; // Methods that affect appearance of geometry: color, texture, etc. @@ -414,12 +414,12 @@ PUBLISHED: bool has_material() const; PT(Material) get_material() const; - void set_fog(qpFog *fog, int priority = 0); + void set_fog(Fog *fog, int priority = 0); void set_fog_off(int priority = 0); void clear_fog(); bool has_fog() const; bool has_fog_off() const; - qpFog *get_fog() const; + Fog *get_fog() const; void set_render_mode_wireframe(int priority = 0); void set_render_mode_filled(int priority = 0); @@ -441,9 +441,9 @@ PUBLISHED: bool has_depth_write() const; bool get_depth_write() const; - void do_billboard_axis(const qpNodePath &camera, float offset); - void do_billboard_point_eye(const qpNodePath &camera, float offset); - void do_billboard_point_world(const qpNodePath &camera, float offset); + void do_billboard_axis(const NodePath &camera, float offset); + void do_billboard_point_eye(const NodePath &camera, float offset); + void do_billboard_point_world(const NodePath &camera, float offset); void set_billboard_axis(float offset = 0.0); void set_billboard_point_eye(float offset = 0.0); void set_billboard_point_world(float offset = 0.0); @@ -463,18 +463,18 @@ PUBLISHED: INLINE void hide(); INLINE void hide(DrawMask camera_mask); INLINE bool is_hidden(DrawMask camera_mask = DrawMask::all_on()) const; - qpNodePath get_hidden_ancestor(DrawMask camera_mask = DrawMask::all_on()) const; + NodePath get_hidden_ancestor(DrawMask camera_mask = DrawMask::all_on()) const; INLINE bool stash(); INLINE bool unstash(); INLINE bool is_stashed() const; - qpNodePath get_stashed_ancestor() const; + NodePath get_stashed_ancestor() const; // Comparison methods - INLINE bool operator == (const qpNodePath &other) const; - INLINE bool operator != (const qpNodePath &other) const; - INLINE bool operator < (const qpNodePath &other) const; - INLINE int compare_to(const qpNodePath &other) const; + INLINE bool operator == (const NodePath &other) const; + INLINE bool operator != (const NodePath &other) const; + INLINE bool operator < (const NodePath &other) const; + INLINE int compare_to(const NodePath &other) const; // Miscellaneous bool verify_complete() const; @@ -496,23 +496,23 @@ PUBLISHED: private: void uncollapse_head() const; - static void find_common_ancestor(const qpNodePath &a, const qpNodePath &b, + static void find_common_ancestor(const NodePath &a, const NodePath &b, int &a_count, int &b_count); - CPT(RenderState) r_get_net_state(qpNodePathComponent *comp) const; - CPT(RenderState) r_get_partial_state(qpNodePathComponent *comp, int n) const; - CPT(TransformState) r_get_net_transform(qpNodePathComponent *comp) const; - CPT(TransformState) r_get_partial_transform(qpNodePathComponent *comp, int n) const; - void r_output(ostream &out, qpNodePathComponent *comp) const; + CPT(RenderState) r_get_net_state(NodePathComponent *comp) const; + CPT(RenderState) r_get_partial_state(NodePathComponent *comp, int n) const; + CPT(TransformState) r_get_net_transform(NodePathComponent *comp) const; + CPT(TransformState) r_get_partial_transform(NodePathComponent *comp, int n) const; + void r_output(ostream &out, NodePathComponent *comp) const; - void find_matches(qpNodePathCollection &result, + void find_matches(NodePathCollection &result, const string &approx_path_str, int max_matches) const; - void find_matches(qpNodePathCollection &result, - qpFindApproxPath &approx_path, + void find_matches(NodePathCollection &result, + FindApproxPath &approx_path, int max_matches) const; - void r_find_matches(qpNodePathCollection &result, - const qpFindApproxLevel &level, + void r_find_matches(NodePathCollection &result, + const FindApproxLevel &level, int max_matches, int num_levels_remaining) const; void r_adjust_all_priorities(PandaNode *node, int adjustment); @@ -530,7 +530,7 @@ private: void r_prepare_scene(PandaNode *node, const RenderState *state, GraphicsStateGuardianBase *gsg, bool do_retained_mode); - PT(qpNodePathComponent) _head; + PT(NodePathComponent) _head; ErrorType _error_type; static int _max_search_depth; @@ -539,18 +539,18 @@ public: return _type_handle; } static void init_type() { - register_type(_type_handle, "qpNodePath"); + register_type(_type_handle, "NodePath"); } private: static TypeHandle _type_handle; - friend class qpNodePathCollection; + friend class NodePathCollection; friend WorkingNodePath; }; -INLINE ostream &operator << (ostream &out, const qpNodePath &node_path); +INLINE ostream &operator << (ostream &out, const NodePath &node_path); -#include "qpnodePath.I" +#include "nodePath.I" #endif diff --git a/panda/src/pgraph/qpnodePathCollection.I b/panda/src/pgraph/nodePathCollection.I similarity index 83% rename from panda/src/pgraph/qpnodePathCollection.I rename to panda/src/pgraph/nodePathCollection.I index cf8ca803b0..eaa2026027 100644 --- a/panda/src/pgraph/qpnodePathCollection.I +++ b/panda/src/pgraph/nodePathCollection.I @@ -1,4 +1,4 @@ -// Filename: qpnodePathCollection.I +// Filename: nodePathCollection.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,21 +18,21 @@ //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::Destructor +// Function: NodePathCollection::Destructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpNodePathCollection:: -~qpNodePathCollection() { +INLINE NodePathCollection:: +~NodePathCollection() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::ls +// Function: NodePathCollection::ls // Access: Published // Description: Lists all the nodes at and below each node in the // collection hierarchically. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePathCollection:: +INLINE void NodePathCollection:: ls() const { ls(nout); } diff --git a/panda/src/pgraph/qpnodePathCollection.cxx b/panda/src/pgraph/nodePathCollection.cxx similarity index 73% rename from panda/src/pgraph/qpnodePathCollection.cxx rename to panda/src/pgraph/nodePathCollection.cxx index ce34566932..2ecb0fa505 100644 --- a/panda/src/pgraph/qpnodePathCollection.cxx +++ b/panda/src/pgraph/nodePathCollection.cxx @@ -1,4 +1,4 @@ -// Filename: qpnodePathCollection.cxx +// Filename: nodePathCollection.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,49 +16,49 @@ // //////////////////////////////////////////////////////////////////// -#include "qpnodePathCollection.h" -#include "qpfindApproxPath.h" -#include "qpfindApproxLevel.h" +#include "nodePathCollection.h" +#include "findApproxPath.h" +#include "findApproxLevel.h" #include "indent.h" //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::Constructor +// Function: NodePathCollection::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpNodePathCollection:: -qpNodePathCollection() { +NodePathCollection:: +NodePathCollection() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::Copy Constructor +// Function: NodePathCollection::Copy Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpNodePathCollection:: -qpNodePathCollection(const qpNodePathCollection ©) : +NodePathCollection:: +NodePathCollection(const NodePathCollection ©) : _node_paths(copy._node_paths) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::Copy Assignment Operator +// Function: NodePathCollection::Copy Assignment Operator // Access: Published // Description: //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -operator = (const qpNodePathCollection ©) { +void NodePathCollection:: +operator = (const NodePathCollection ©) { _node_paths = copy._node_paths; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::add_path +// Function: NodePathCollection::add_path // Access: Published -// Description: Adds a new qpNodePath to the collection. +// Description: Adds a new NodePath to the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -add_path(const qpNodePath &node_path) { +void NodePathCollection:: +add_path(const NodePath &node_path) { // If the pointer to our internal array is shared by any other // NodePathCollections, we have to copy the array now so we won't // inadvertently modify any of our brethren NodePathCollection @@ -74,14 +74,14 @@ add_path(const qpNodePath &node_path) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::remove_path +// Function: NodePathCollection::remove_path // Access: Published -// Description: Removes the indicated qpNodePath from the collection. +// Description: Removes the indicated NodePath from the collection. // Returns true if the path was removed, false if it was // not a member of the collection. //////////////////////////////////////////////////////////////////// -bool qpNodePathCollection:: -remove_path(const qpNodePath &node_path) { +bool NodePathCollection:: +remove_path(const NodePath &node_path) { int path_index = -1; for (int i = 0; path_index == -1 && i < (int)_node_paths.size(); i++) { if (_node_paths[i] == node_path) { @@ -110,15 +110,15 @@ remove_path(const qpNodePath &node_path) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::add_paths_from +// Function: NodePathCollection::add_paths_from // Access: Published -// Description: Adds all the qpNodePaths indicated in the other +// Description: Adds all the NodePaths indicated in the other // collection to this path. The other paths are simply // appended to the end of the paths in this list; // duplicates are not automatically removed. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -add_paths_from(const qpNodePathCollection &other) { +void NodePathCollection:: +add_paths_from(const NodePathCollection &other) { int other_num_paths = other.get_num_paths(); for (int i = 0; i < other_num_paths; i++) { add_path(other.get_path(i)); @@ -127,17 +127,17 @@ add_paths_from(const qpNodePathCollection &other) { //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::remove_paths_from +// Function: NodePathCollection::remove_paths_from // Access: Published -// Description: Removes from this collection all of the qpNodePaths +// Description: Removes from this collection all of the NodePaths // listed in the other collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -remove_paths_from(const qpNodePathCollection &other) { +void NodePathCollection:: +remove_paths_from(const NodePathCollection &other) { NodePaths new_paths; int num_paths = get_num_paths(); for (int i = 0; i < num_paths; i++) { - qpNodePath path = get_path(i); + NodePath path = get_path(i); if (!other.has_path(path)) { new_paths.push_back(path); } @@ -146,20 +146,20 @@ remove_paths_from(const qpNodePathCollection &other) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::remove_duplicate_paths +// Function: NodePathCollection::remove_duplicate_paths // Access: Published // Description: Removes any duplicate entries of the same NodePaths -// on this collection. If a qpNodePath appears multiple +// on this collection. If a NodePath appears multiple // times, the first appearance is retained; subsequent // appearances are removed. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: remove_duplicate_paths() { NodePaths new_paths; int num_paths = get_num_paths(); for (int i = 0; i < num_paths; i++) { - qpNodePath path = get_path(i); + NodePath path = get_path(i); bool duplicated = false; for (int j = 0; j < i && !duplicated; j++) { @@ -175,13 +175,13 @@ remove_duplicate_paths() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::has_path +// Function: NodePathCollection::has_path // Access: Published -// Description: Returns true if the indicated qpNodePath appears in +// Description: Returns true if the indicated NodePath appears in // this collection, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePathCollection:: -has_path(const qpNodePath &path) const { +bool NodePathCollection:: +has_path(const NodePath &path) const { for (int i = 0; i < get_num_paths(); i++) { if (path == get_path(i)) { return true; @@ -191,72 +191,72 @@ has_path(const qpNodePath &path) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::clear +// Function: NodePathCollection::clear // Access: Published // Description: Removes all NodePaths from the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: clear() { _node_paths.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::is_empty +// Function: NodePathCollection::is_empty // Access: Published // Description: Returns true if there are no NodePaths in the // collection, false otherwise. //////////////////////////////////////////////////////////////////// -bool qpNodePathCollection:: +bool NodePathCollection:: is_empty() const { return _node_paths.empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::get_num_paths +// Function: NodePathCollection::get_num_paths // Access: Published // Description: Returns the number of NodePaths in the collection. //////////////////////////////////////////////////////////////////// -int qpNodePathCollection:: +int NodePathCollection:: get_num_paths() const { return _node_paths.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::get_path +// Function: NodePathCollection::get_path // Access: Published -// Description: Returns the nth qpNodePath in the collection. +// Description: Returns the nth NodePath in the collection. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePathCollection:: +NodePath NodePathCollection:: get_path(int index) const { - nassertr(index >= 0 && index < (int)_node_paths.size(), qpNodePath()); + nassertr(index >= 0 && index < (int)_node_paths.size(), NodePath()); return _node_paths[index]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::operator [] +// Function: NodePathCollection::operator [] // Access: Published -// Description: Returns the nth qpNodePath in the collection. This is +// Description: Returns the nth NodePath in the collection. This is // the same as get_path(), but it may be a more // convenient way to access it. //////////////////////////////////////////////////////////////////// -qpNodePath qpNodePathCollection:: +NodePath NodePathCollection:: operator [] (int index) const { - nassertr(index >= 0 && index < (int)_node_paths.size(), qpNodePath()); + nassertr(index >= 0 && index < (int)_node_paths.size(), NodePath()); return _node_paths[index]; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::ls +// Function: NodePathCollection::ls // Access: Published // Description: Lists all the nodes at and below each node in the // collection hierarchically. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: ls(ostream &out, int indent_level) const { for (int i = 0; i < get_num_paths(); i++) { - qpNodePath path = get_path(i); + NodePath path = get_path(i); indent(out, indent_level) << path << "\n"; path.ls(out, indent_level + 2); out << "\n"; @@ -264,27 +264,27 @@ ls(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::find_all_matches +// Function: NodePathCollection::find_all_matches // Access: Published // Description: Returns the complete set of all NodePaths that begin -// with any qpNodePath in this collection and can be +// with any NodePath in this collection and can be // extended by path. The shortest paths will be listed // first. //////////////////////////////////////////////////////////////////// -qpNodePathCollection qpNodePathCollection:: +NodePathCollection NodePathCollection:: find_all_matches(const string &path) const { - qpNodePathCollection result; + NodePathCollection result; - qpFindApproxPath approx_path; + FindApproxPath approx_path; if (approx_path.add_string(path)) { if (!is_empty()) { - qpFindApproxLevel level; + FindApproxLevel level; for (int i = 0; i < get_num_paths(); i++) { - qpFindApproxLevelEntry start(get_path(i), approx_path); + FindApproxLevelEntry start(get_path(i), approx_path); level.add_entry(start); } get_path(0).r_find_matches(result, level, -1, - qpNodePath::get_max_search_depth()); + NodePath::get_max_search_depth()); } } @@ -292,38 +292,38 @@ find_all_matches(const string &path) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::reparent_to +// Function: NodePathCollection::reparent_to // Access: Published // Description: Reparents all the NodePaths in the collection to the // indicated node. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -reparent_to(const qpNodePath &other) { +void NodePathCollection:: +reparent_to(const NodePath &other) { for (int i = 0; i < get_num_paths(); i++) { get_path(i).reparent_to(other); } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::wrt_reparent_to +// Function: NodePathCollection::wrt_reparent_to // Access: Published // Description: Reparents all the NodePaths in the collection to the // indicated node, adjusting each transform so as not to // move in world coordinates. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: -wrt_reparent_to(const qpNodePath &other) { +void NodePathCollection:: +wrt_reparent_to(const NodePath &other) { for (int i = 0; i < get_num_paths(); i++) { get_path(i).wrt_reparent_to(other); } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::show +// Function: NodePathCollection::show // Access: Published // Description: Shows all NodePaths in the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: show() { for (int i = 0; i < get_num_paths(); i++) { get_path(i).show(); @@ -331,11 +331,11 @@ show() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::show +// Function: NodePathCollection::show // Access: Published // Description: Hides all NodePaths in the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: hide() { for (int i = 0; i < get_num_paths(); i++) { get_path(i).hide(); @@ -343,11 +343,11 @@ hide() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::stash +// Function: NodePathCollection::stash // Access: Published // Description: Stashes all NodePaths in the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: stash() { for (int i = 0; i < get_num_paths(); i++) { get_path(i).stash(); @@ -355,11 +355,11 @@ stash() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::unstash +// Function: NodePathCollection::unstash // Access: Published // Description: Unstashes all NodePaths in the collection. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: unstash() { for (int i = 0; i < get_num_paths(); i++) { get_path(i).unstash(); @@ -367,12 +367,12 @@ unstash() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::output +// Function: NodePathCollection::output // Access: Published // Description: Writes a brief one-line description of the -// qpNodePathCollection to the indicated output stream. +// NodePathCollection to the indicated output stream. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: output(ostream &out) const { if (get_num_paths() == 1) { out << "1 NodePath"; @@ -382,12 +382,12 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathCollection::write +// Function: NodePathCollection::write // Access: Published // Description: Writes a complete multi-line description of the -// qpNodePathCollection to the indicated output stream. +// NodePathCollection to the indicated output stream. //////////////////////////////////////////////////////////////////// -void qpNodePathCollection:: +void NodePathCollection:: write(ostream &out, int indent_level) const { for (int i = 0; i < get_num_paths(); i++) { indent(out, indent_level) << get_path(i) << "\n"; diff --git a/panda/src/pgraph/qpnodePathCollection.h b/panda/src/pgraph/nodePathCollection.h similarity index 61% rename from panda/src/pgraph/qpnodePathCollection.h rename to panda/src/pgraph/nodePathCollection.h index 486ed48f18..33ebe9c707 100644 --- a/panda/src/pgraph/qpnodePathCollection.h +++ b/panda/src/pgraph/nodePathCollection.h @@ -1,4 +1,4 @@ -// Filename: qpnodePathCollection.h +// Filename: nodePathCollection.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,11 +16,11 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpNODEPATHCOLLECTION_H -#define qpNODEPATHCOLLECTION_H +#ifndef NODEPATHCOLLECTION_H +#define NODEPATHCOLLECTION_H #include "pandabase.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "pointerToArray.h" //////////////////////////////////////////////////////////////////// @@ -30,33 +30,33 @@ // multiple NodePaths (for instance, // NodePaths::get_children). //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpNodePathCollection { +class EXPCL_PANDA NodePathCollection { PUBLISHED: - qpNodePathCollection(); - qpNodePathCollection(const qpNodePathCollection ©); - void operator = (const qpNodePathCollection ©); - INLINE ~qpNodePathCollection(); + NodePathCollection(); + NodePathCollection(const NodePathCollection ©); + void operator = (const NodePathCollection ©); + INLINE ~NodePathCollection(); - void add_path(const qpNodePath &node_path); - bool remove_path(const qpNodePath &node_path); - void add_paths_from(const qpNodePathCollection &other); - void remove_paths_from(const qpNodePathCollection &other); + void add_path(const NodePath &node_path); + bool remove_path(const NodePath &node_path); + void add_paths_from(const NodePathCollection &other); + void remove_paths_from(const NodePathCollection &other); void remove_duplicate_paths(); - bool has_path(const qpNodePath &path) const; + bool has_path(const NodePath &path) const; void clear(); bool is_empty() const; int get_num_paths() const; - qpNodePath get_path(int index) const; - qpNodePath operator [] (int index) const; + NodePath get_path(int index) const; + NodePath operator [] (int index) const; // Handy operations on many NodePaths at once. INLINE void ls() const; void ls(ostream &out, int indent_level = 0) const; - qpNodePathCollection find_all_matches(const string &path) const; - void reparent_to(const qpNodePath &other); - void wrt_reparent_to(const qpNodePath &other); + NodePathCollection find_all_matches(const string &path) const; + void reparent_to(const NodePath &other); + void wrt_reparent_to(const NodePath &other); void show(); void hide(); @@ -67,16 +67,16 @@ PUBLISHED: void write(ostream &out, int indent_level = 0) const; private: - typedef PTA(qpNodePath) NodePaths; + typedef PTA(NodePath) NodePaths; NodePaths _node_paths; }; -INLINE ostream &operator << (ostream &out, const qpNodePathCollection &col) { +INLINE ostream &operator << (ostream &out, const NodePathCollection &col) { col.output(out); return out; } -#include "qpnodePathCollection.I" +#include "nodePathCollection.I" #endif diff --git a/panda/src/pgraph/qpnodePathComponent.I b/panda/src/pgraph/nodePathComponent.I similarity index 72% rename from panda/src/pgraph/qpnodePathComponent.I rename to panda/src/pgraph/nodePathComponent.I index cfdc128702..364a698d32 100644 --- a/panda/src/pgraph/qpnodePathComponent.I +++ b/panda/src/pgraph/nodePathComponent.I @@ -1,4 +1,4 @@ -// Filename: qpnodePathComponent.I +// Filename: nodePathComponent.I // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -18,36 +18,36 @@ //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::CData::Constructor +// Function: NodePathComponent::CData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent::CData:: +INLINE NodePathComponent::CData:: CData() { _length = 1; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::CData::Copy Constructor +// Function: NodePathComponent::CData::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent::CData:: -CData(const qpNodePathComponent::CData ©) : +INLINE NodePathComponent::CData:: +CData(const NodePathComponent::CData ©) : _next(copy._next), _length(copy._length) { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::Constructor +// Function: NodePathComponent::Constructor // Access: Private -// Description: Constructs a new qpNodePathComponent from the +// Description: Constructs a new NodePathComponent from the // indicated node. Don't try to call this directly; ask // the PandaNode to do it for you. //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent:: -qpNodePathComponent(PandaNode *node, qpNodePathComponent *next) : +INLINE NodePathComponent:: +NodePathComponent(PandaNode *node, NodePathComponent *next) : _node(node), _key(0) { @@ -57,49 +57,49 @@ qpNodePathComponent(PandaNode *node, qpNodePathComponent *next) : CDWriter cdata(_cycler); cdata->_next = next; - if (next != (qpNodePathComponent *)NULL) { + if (next != (NodePathComponent *)NULL) { cdata->_length = next->get_length() + 1; } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::Copy Constructor +// Function: NodePathComponent::Copy Constructor // Access: Private -// Description: qpNodePathComponents should not be copied. +// Description: NodePathComponents should not be copied. //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent:: -qpNodePathComponent(const qpNodePathComponent ©) { +INLINE NodePathComponent:: +NodePathComponent(const NodePathComponent ©) { nassertv(false); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::Copy Assignment Operator +// Function: NodePathComponent::Copy Assignment Operator // Access: Private -// Description: qpNodePathComponents should not be copied. +// Description: NodePathComponents should not be copied. //////////////////////////////////////////////////////////////////// -INLINE void qpNodePathComponent:: -operator = (const qpNodePathComponent ©) { +INLINE void NodePathComponent:: +operator = (const NodePathComponent ©) { nassertv(false); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::Destructor +// Function: NodePathComponent::Destructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent:: -~qpNodePathComponent() { +INLINE NodePathComponent:: +~NodePathComponent() { nassertv(_node != (PandaNode *)NULL); _node->delete_component(this); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::get_node +// Function: NodePathComponent::get_node // Access: Public // Description: Returns the node referenced by this component. //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpNodePathComponent:: +INLINE PandaNode *NodePathComponent:: get_node() const { // We don't have to bother checking if the component has been // collapsed here, since the _node pointer will still be the same @@ -109,29 +109,29 @@ get_node() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::is_collapsed +// Function: NodePathComponent::is_collapsed // Access: Public // Description: Returns true if this component has been collapsed // with another component. In this case, the component // itself is invalid, and the collapsed component should // be used instead. //////////////////////////////////////////////////////////////////// -INLINE bool qpNodePathComponent:: +INLINE bool NodePathComponent:: is_collapsed() const { CDReader cdata(_cycler); return (cdata->_length == 0); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::get_collapsed +// Function: NodePathComponent::get_collapsed // Access: Public // Description: If is_collapsed() returns true, this is the component // that this one has been collapsed with, and should be // replaced with. //////////////////////////////////////////////////////////////////// -INLINE qpNodePathComponent *qpNodePathComponent:: +INLINE NodePathComponent *NodePathComponent:: get_collapsed() const { - nassertr(is_collapsed(), (qpNodePathComponent *)NULL); + nassertr(is_collapsed(), (NodePathComponent *)NULL); CDReader cdata(_cycler); return cdata->_next; } diff --git a/panda/src/pgraph/qpnodePathComponent.cxx b/panda/src/pgraph/nodePathComponent.cxx similarity index 79% rename from panda/src/pgraph/qpnodePathComponent.cxx rename to panda/src/pgraph/nodePathComponent.cxx index 5f979ad960..e7a88eaef6 100644 --- a/panda/src/pgraph/qpnodePathComponent.cxx +++ b/panda/src/pgraph/nodePathComponent.cxx @@ -1,4 +1,4 @@ -// Filename: qpnodePathComponent.cxx +// Filename: nodePathComponent.cxx // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,34 +16,34 @@ // //////////////////////////////////////////////////////////////////// -#include "qpnodePathComponent.h" +#include "nodePathComponent.h" // We start the key counters off at 1, since 0 is reserved for an // empty NodePath (and also for an unassigned key). -int qpNodePathComponent::_next_key = 1; -TypeHandle qpNodePathComponent::_type_handle; +int NodePathComponent::_next_key = 1; +TypeHandle NodePathComponent::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::CData::make_copy +// Function: NodePathComponent::CData::make_copy // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -CycleData *qpNodePathComponent::CData:: +CycleData *NodePathComponent::CData:: make_copy() const { return new CData(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::get_key +// Function: NodePathComponent::get_key // Access: Public // Description: Returns an index number that is guaranteed to be // unique for this particular NodePathComponent, and not // to be reused for the lifetime of the application // (barring integer overflow). //////////////////////////////////////////////////////////////////// -int qpNodePathComponent:: +int NodePathComponent:: get_key() const { if (is_collapsed()) { return get_collapsed()->get_key(); @@ -54,32 +54,32 @@ get_key() const { // index numbers generating a unique number for *every* component // in the world (we only have 4.2 billion 32-bit integers, after // all) - ((qpNodePathComponent *)this)->_key = _next_key++; + ((NodePathComponent *)this)->_key = _next_key++; } return _key; } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::is_top_node +// Function: NodePathComponent::is_top_node // Access: Public // Description: Returns true if this component represents the top // node in the path. //////////////////////////////////////////////////////////////////// -bool qpNodePathComponent:: +bool NodePathComponent:: is_top_node() const { if (is_collapsed()) { return get_collapsed()->is_top_node(); } CDReader cdata(_cycler); - return (cdata->_next == (qpNodePathComponent *)NULL); + return (cdata->_next == (NodePathComponent *)NULL); } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::get_length +// Function: NodePathComponent::get_length // Access: Public // Description: Returns the length of the path to this node. //////////////////////////////////////////////////////////////////// -int qpNodePathComponent:: +int NodePathComponent:: get_length() const { if (is_collapsed()) { return get_collapsed()->get_length(); @@ -89,27 +89,27 @@ get_length() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::get_next +// Function: NodePathComponent::get_next // Access: Public // Description: Returns the next component in the path. //////////////////////////////////////////////////////////////////// -qpNodePathComponent *qpNodePathComponent:: +NodePathComponent *NodePathComponent:: get_next() const { if (is_collapsed()) { return get_collapsed()->get_next(); } CDReader cdata(_cycler); - qpNodePathComponent *next = cdata->_next; + NodePathComponent *next = cdata->_next; // If the next component has been collapsed, transparently update // the pointer to get the actual node, and store the new pointer, // before we return. Collapsing can happen at any time to any // component in the path and we have to deal with it. - if (next != (qpNodePathComponent *)NULL && next->is_collapsed()) { + if (next != (NodePathComponent *)NULL && next->is_collapsed()) { next = next->uncollapse(); - CDWriter cdata_w(((qpNodePathComponent *)this)->_cycler, cdata); + CDWriter cdata_w(((NodePathComponent *)this)->_cycler, cdata); cdata_w->_next = next; } @@ -117,14 +117,14 @@ get_next() const { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::fix_length +// Function: NodePathComponent::fix_length // Access: Public // Description: Checks that the length indicated by the component is // one more than the length of its predecessor. If this // is broken, fixes it and returns true indicating the // component has been changed; otherwise, returns false. //////////////////////////////////////////////////////////////////// -bool qpNodePathComponent:: +bool NodePathComponent:: fix_length() { int length_should_be = 1; if (!is_top_node()) { @@ -140,7 +140,7 @@ fix_length() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::uncollapse +// Function: NodePathComponent::uncollapse // Access: Public // Description: Returns this component pointer if the component is // not collapsed; or if it has been collapsed, returns @@ -151,9 +151,9 @@ fix_length() { // when a node is removed further up the path that // results in two instances becoming the same thing. //////////////////////////////////////////////////////////////////// -qpNodePathComponent *qpNodePathComponent:: +NodePathComponent *NodePathComponent:: uncollapse() { - qpNodePathComponent *comp = this; + NodePathComponent *comp = this; while (comp->is_collapsed()) { comp = comp->get_collapsed(); @@ -163,50 +163,50 @@ uncollapse() { } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::set_next +// Function: NodePathComponent::set_next // Access: Private // Description: Sets the next pointer in the path. //////////////////////////////////////////////////////////////////// -void qpNodePathComponent:: -set_next(qpNodePathComponent *next) { +void NodePathComponent:: +set_next(NodePathComponent *next) { if (is_collapsed()) { get_collapsed()->set_next(next); } else { - nassertv(next != (qpNodePathComponent *)NULL); + nassertv(next != (NodePathComponent *)NULL); CDWriter cdata(_cycler); cdata->_next = next; } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::set_top_node +// Function: NodePathComponent::set_top_node // Access: Private // Description: Severs any connection to the next pointer in the // path and makes this component a top node. //////////////////////////////////////////////////////////////////// -void qpNodePathComponent:: +void NodePathComponent:: set_top_node() { if (is_collapsed()) { get_collapsed()->set_top_node(); } else { CDWriter cdata(_cycler); - cdata->_next = (qpNodePathComponent *)NULL; + cdata->_next = (NodePathComponent *)NULL; } } //////////////////////////////////////////////////////////////////// -// Function: qpNodePathComponent::collapse_with +// Function: NodePathComponent::collapse_with // Access: Private // Description: Indicates that this component pointer is no longer // valid, and that the indicated component should be // used instead. This is done whenever two -// qpNodePathComponents have been collapsed together due +// NodePathComponents have been collapsed together due // to an instance being removed higher up in the graph. //////////////////////////////////////////////////////////////////// -void qpNodePathComponent:: -collapse_with(qpNodePathComponent *next) { +void NodePathComponent:: +collapse_with(NodePathComponent *next) { nassertv(!is_collapsed()); - nassertv(next != (qpNodePathComponent *)NULL); + nassertv(next != (NodePathComponent *)NULL); CDWriter cdata(_cycler); // We indicate a component has been collapsed by setting its length diff --git a/panda/src/pgraph/qpnodePathComponent.h b/panda/src/pgraph/nodePathComponent.h similarity index 78% rename from panda/src/pgraph/qpnodePathComponent.h rename to panda/src/pgraph/nodePathComponent.h index 7ef4dee10a..3c51de1b21 100644 --- a/panda/src/pgraph/qpnodePathComponent.h +++ b/panda/src/pgraph/nodePathComponent.h @@ -1,4 +1,4 @@ -// Filename: qpnodePathComponent.h +// Filename: nodePathComponent.h // Created by: drose (25Feb02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpNODEPATHCOMPONENT_H -#define qpNODEPATHCOMPONENT_H +#ifndef NODEPATHCOMPONENT_H +#define NODEPATHCOMPONENT_H #include "pandabase.h" @@ -29,7 +29,7 @@ #include "cycleDataWriter.h" //////////////////////////////////////////////////////////////////// -// Class : qpNodePathComponent +// Class : NodePathComponent // Description : This is one component of a NodePath. These are // stored on each PandaNode, as many as one for each of // the possible instances of the node (but they only @@ -44,31 +44,31 @@ // to allow the nodes to keep these up to date as the // scene graph is manipulated. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpNodePathComponent : public ReferenceCount { +class EXPCL_PANDA NodePathComponent : public ReferenceCount { private: - INLINE qpNodePathComponent(PandaNode *node, qpNodePathComponent *next = NULL); - INLINE qpNodePathComponent(const qpNodePathComponent ©); - INLINE void operator = (const qpNodePathComponent ©); + INLINE NodePathComponent(PandaNode *node, NodePathComponent *next = NULL); + INLINE NodePathComponent(const NodePathComponent ©); + INLINE void operator = (const NodePathComponent ©); public: - INLINE ~qpNodePathComponent(); + INLINE ~NodePathComponent(); INLINE PandaNode *get_node() const; int get_key() const; bool is_top_node() const; INLINE bool is_collapsed() const; - qpNodePathComponent *get_next() const; + NodePathComponent *get_next() const; int get_length() const; - INLINE qpNodePathComponent *get_collapsed() const; + INLINE NodePathComponent *get_collapsed() const; bool fix_length(); - qpNodePathComponent *uncollapse(); + NodePathComponent *uncollapse(); private: - void set_next(qpNodePathComponent *next); + void set_next(NodePathComponent *next); void set_top_node(); - void collapse_with(qpNodePathComponent *next); + void collapse_with(NodePathComponent *next); // We don't have to cycle the _node and _key elements, since these // are permanent properties of this object. (Well, the _key is @@ -84,7 +84,7 @@ private: CData(const CData ©); virtual CycleData *make_copy() const; - PT(qpNodePathComponent) _next; + PT(NodePathComponent) _next; int _length; }; @@ -100,7 +100,7 @@ public: } static void init_type() { ReferenceCount::init_type(); - register_type(_type_handle, "qpNodePathComponent", + register_type(_type_handle, "NodePathComponent", ReferenceCount::get_class_type()); } @@ -109,6 +109,6 @@ private: friend class PandaNode; }; -#include "qpnodePathComponent.I" +#include "nodePathComponent.I" #endif diff --git a/panda/src/pgraph/qpnodePathLerps.cxx b/panda/src/pgraph/nodePathLerps.cxx similarity index 67% rename from panda/src/pgraph/qpnodePathLerps.cxx rename to panda/src/pgraph/nodePathLerps.cxx index 471fcda60d..9d72863e06 100644 --- a/panda/src/pgraph/qpnodePathLerps.cxx +++ b/panda/src/pgraph/nodePathLerps.cxx @@ -1,4 +1,4 @@ -// Filename: qpnodePathLerps.cxx +// Filename: nodePathLerps.cxx // Created by: frang (01Jun00) // //////////////////////////////////////////////////////////////////// @@ -16,42 +16,42 @@ // //////////////////////////////////////////////////////////////////// -#include "qpnodePathLerps.h" +#include "nodePathLerps.h" -TypeHandle qpPosLerpFunctor::_type_handle; -TypeHandle qpHprLerpFunctor::_type_handle; -TypeHandle qpScaleLerpFunctor::_type_handle; -TypeHandle qpColorLerpFunctor::_type_handle; -TypeHandle qpPosHprLerpFunctor::_type_handle; -TypeHandle qpHprScaleLerpFunctor::_type_handle; -TypeHandle qpPosHprScaleLerpFunctor::_type_handle; -TypeHandle qpColorScaleLerpFunctor::_type_handle; +TypeHandle PosLerpFunctor::_type_handle; +TypeHandle HprLerpFunctor::_type_handle; +TypeHandle ScaleLerpFunctor::_type_handle; +TypeHandle ColorLerpFunctor::_type_handle; +TypeHandle PosHprLerpFunctor::_type_handle; +TypeHandle HprScaleLerpFunctor::_type_handle; +TypeHandle PosHprScaleLerpFunctor::_type_handle; +TypeHandle ColorScaleLerpFunctor::_type_handle; -qpPosLerpFunctor::qpPosLerpFunctor(const qpPosLerpFunctor& c) +PosLerpFunctor::PosLerpFunctor(const PosLerpFunctor& c) : LPoint3fLerpFunctor(c), _node_path(c._node_path) {} -qpPosLerpFunctor::~qpPosLerpFunctor(void) +PosLerpFunctor::~PosLerpFunctor(void) { } -qpPosLerpFunctor& qpPosLerpFunctor::operator=(const qpPosLerpFunctor& c) { +PosLerpFunctor& PosLerpFunctor::operator=(const PosLerpFunctor& c) { _node_path = c._node_path; LPoint3fLerpFunctor::operator=(c); return *this; } -void qpPosLerpFunctor::operator()(float t) { +void PosLerpFunctor::operator()(float t) { if (_is_wrt) _node_path.set_pos(_wrt_path, interpolate(t)); else _node_path.set_pos(interpolate(t)); } -qpHprLerpFunctor::qpHprLerpFunctor(const qpHprLerpFunctor& c) +HprLerpFunctor::HprLerpFunctor(const HprLerpFunctor& c) : LVecBase3fLerpFunctor(c), _node_path(c._node_path) {} -void qpHprLerpFunctor::take_shortest(void) { +void HprLerpFunctor::take_shortest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if (this->_diff_cache[i] < -180.) @@ -61,7 +61,7 @@ void qpHprLerpFunctor::take_shortest(void) { this->_diff_cache = this->_end - this->_start; } -void qpHprLerpFunctor::take_longest(void) { +void HprLerpFunctor::take_longest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if ((this->_diff_cache[i] < 0.) && (this->_diff_cache[i] > -180.)) @@ -71,65 +71,65 @@ void qpHprLerpFunctor::take_longest(void) { this->_diff_cache = this->_end - this->_start; } -qpHprLerpFunctor::~qpHprLerpFunctor(void) +HprLerpFunctor::~HprLerpFunctor(void) { } -qpHprLerpFunctor& qpHprLerpFunctor::operator=(const qpHprLerpFunctor& c) { +HprLerpFunctor& HprLerpFunctor::operator=(const HprLerpFunctor& c) { _node_path = c._node_path; LVecBase3fLerpFunctor::operator=(c); return *this; } -void qpHprLerpFunctor::operator()(float t) { +void HprLerpFunctor::operator()(float t) { if (_is_wrt) _node_path.set_hpr(_wrt_path, interpolate(t)); else _node_path.set_hpr(interpolate(t)); } -qpScaleLerpFunctor::qpScaleLerpFunctor(const qpScaleLerpFunctor& c) +ScaleLerpFunctor::ScaleLerpFunctor(const ScaleLerpFunctor& c) : LVecBase3fLerpFunctor(c), _node_path(c._node_path) {} -qpScaleLerpFunctor::~qpScaleLerpFunctor(void) +ScaleLerpFunctor::~ScaleLerpFunctor(void) { } -qpScaleLerpFunctor& qpScaleLerpFunctor::operator=(const qpScaleLerpFunctor& c) { +ScaleLerpFunctor& ScaleLerpFunctor::operator=(const ScaleLerpFunctor& c) { _node_path = c._node_path; LVecBase3fLerpFunctor::operator=(c); return *this; } -void qpScaleLerpFunctor::operator()(float t) { +void ScaleLerpFunctor::operator()(float t) { if (_is_wrt) _node_path.set_scale(_wrt_path, interpolate(t)); else _node_path.set_scale(interpolate(t)); } -qpColorLerpFunctor::qpColorLerpFunctor(const qpColorLerpFunctor& c) +ColorLerpFunctor::ColorLerpFunctor(const ColorLerpFunctor& c) : LVecBase4fLerpFunctor(c), _node_path(c._node_path) {} -qpColorLerpFunctor::~qpColorLerpFunctor(void) +ColorLerpFunctor::~ColorLerpFunctor(void) { } -qpColorLerpFunctor& qpColorLerpFunctor::operator=(const qpColorLerpFunctor& c) { +ColorLerpFunctor& ColorLerpFunctor::operator=(const ColorLerpFunctor& c) { _node_path = c._node_path; LVecBase4fLerpFunctor::operator=(c); return *this; } -void qpColorLerpFunctor::operator()(float t) { +void ColorLerpFunctor::operator()(float t) { _node_path.set_color(interpolate(t)); } -qpPosHprLerpFunctor::qpPosHprLerpFunctor(const qpPosHprLerpFunctor& c) +PosHprLerpFunctor::PosHprLerpFunctor(const PosHprLerpFunctor& c) : LerpFunctor(c), _node_path(c._node_path) {} -void qpPosHprLerpFunctor::take_shortest(void) { +void PosHprLerpFunctor::take_shortest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if (this->_hdiff_cache[i] < -180.) @@ -139,7 +139,7 @@ void qpPosHprLerpFunctor::take_shortest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -void qpPosHprLerpFunctor::take_longest(void) { +void PosHprLerpFunctor::take_longest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if ((this->_hdiff_cache[i] < 0.) && (this->_hdiff_cache[i] > -180.)) @@ -149,11 +149,11 @@ void qpPosHprLerpFunctor::take_longest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -qpPosHprLerpFunctor::~qpPosHprLerpFunctor(void) +PosHprLerpFunctor::~PosHprLerpFunctor(void) { } -qpPosHprLerpFunctor& qpPosHprLerpFunctor::operator=(const qpPosHprLerpFunctor& c) { +PosHprLerpFunctor& PosHprLerpFunctor::operator=(const PosHprLerpFunctor& c) { _node_path = c._node_path; _pstart = c._pstart; _pend = c._pend; @@ -165,7 +165,7 @@ qpPosHprLerpFunctor& qpPosHprLerpFunctor::operator=(const qpPosHprLerpFunctor& c return *this; } -void qpPosHprLerpFunctor::operator()(float t) { +void PosHprLerpFunctor::operator()(float t) { LPoint3f p = ((t * _pdiff_cache) + _pstart); LVecBase3f h = ((t * _hdiff_cache) + _hstart); if (_is_wrt) @@ -174,10 +174,10 @@ void qpPosHprLerpFunctor::operator()(float t) { _node_path.set_pos_hpr(p, h); } -qpHprScaleLerpFunctor::qpHprScaleLerpFunctor(const qpHprScaleLerpFunctor& c) +HprScaleLerpFunctor::HprScaleLerpFunctor(const HprScaleLerpFunctor& c) : LerpFunctor(c), _node_path(c._node_path) {} -void qpHprScaleLerpFunctor::take_shortest(void) { +void HprScaleLerpFunctor::take_shortest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if (this->_hdiff_cache[i] < -180.) @@ -187,7 +187,7 @@ void qpHprScaleLerpFunctor::take_shortest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -void qpHprScaleLerpFunctor::take_longest(void) { +void HprScaleLerpFunctor::take_longest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if ((this->_hdiff_cache[i] < 0.) && (this->_hdiff_cache[i] > -180.)) @@ -197,12 +197,12 @@ void qpHprScaleLerpFunctor::take_longest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -qpHprScaleLerpFunctor::~qpHprScaleLerpFunctor(void) +HprScaleLerpFunctor::~HprScaleLerpFunctor(void) { } -qpHprScaleLerpFunctor& -qpHprScaleLerpFunctor::operator=(const qpHprScaleLerpFunctor& c) { +HprScaleLerpFunctor& +HprScaleLerpFunctor::operator=(const HprScaleLerpFunctor& c) { _node_path = c._node_path; _hstart = c._hstart; _hend = c._hend; @@ -214,7 +214,7 @@ qpHprScaleLerpFunctor::operator=(const qpHprScaleLerpFunctor& c) { return *this; } -void qpHprScaleLerpFunctor::operator()(float t) { +void HprScaleLerpFunctor::operator()(float t) { LVecBase3f h = ((t * _hdiff_cache) + _hstart); LVecBase3f s = ((t * _sdiff_cache) + _sstart); if (_is_wrt) @@ -223,10 +223,10 @@ void qpHprScaleLerpFunctor::operator()(float t) { _node_path.set_hpr_scale(h, s); } -qpPosHprScaleLerpFunctor::qpPosHprScaleLerpFunctor(const qpPosHprScaleLerpFunctor& c) +PosHprScaleLerpFunctor::PosHprScaleLerpFunctor(const PosHprScaleLerpFunctor& c) : LerpFunctor(c), _node_path(c._node_path) {} -void qpPosHprScaleLerpFunctor::take_shortest(void) { +void PosHprScaleLerpFunctor::take_shortest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if (this->_hdiff_cache[i] < -180.) @@ -236,7 +236,7 @@ void qpPosHprScaleLerpFunctor::take_shortest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -void qpPosHprScaleLerpFunctor::take_longest(void) { +void PosHprScaleLerpFunctor::take_longest(void) { // so long as these are actually degrees for (int i=0; i!=3; ++i) if ((this->_hdiff_cache[i] < 0.) && (this->_hdiff_cache[i] > -180.)) @@ -246,12 +246,12 @@ void qpPosHprScaleLerpFunctor::take_longest(void) { this->_hdiff_cache = this->_hend - this->_hstart; } -qpPosHprScaleLerpFunctor::~qpPosHprScaleLerpFunctor(void) +PosHprScaleLerpFunctor::~PosHprScaleLerpFunctor(void) { } -qpPosHprScaleLerpFunctor& -qpPosHprScaleLerpFunctor::operator=(const qpPosHprScaleLerpFunctor& c) { +PosHprScaleLerpFunctor& +PosHprScaleLerpFunctor::operator=(const PosHprScaleLerpFunctor& c) { _node_path = c._node_path; _pstart = c._pstart; _pend = c._pend; @@ -266,7 +266,7 @@ qpPosHprScaleLerpFunctor::operator=(const qpPosHprScaleLerpFunctor& c) { return *this; } -void qpPosHprScaleLerpFunctor::operator()(float t) { +void PosHprScaleLerpFunctor::operator()(float t) { LPoint3f p = ((t * _pdiff_cache) + _pstart); LVecBase3f h = ((t * _hdiff_cache) + _hstart); LVecBase3f s = ((t * _sdiff_cache) + _sstart); @@ -276,20 +276,20 @@ void qpPosHprScaleLerpFunctor::operator()(float t) { _node_path.set_pos_hpr_scale(p, h, s); } -qpColorScaleLerpFunctor::qpColorScaleLerpFunctor(const qpColorScaleLerpFunctor& c) +ColorScaleLerpFunctor::ColorScaleLerpFunctor(const ColorScaleLerpFunctor& c) : LVecBase4fLerpFunctor(c), _node_path(c._node_path) {} -qpColorScaleLerpFunctor::~qpColorScaleLerpFunctor(void) +ColorScaleLerpFunctor::~ColorScaleLerpFunctor(void) { } -qpColorScaleLerpFunctor& qpColorScaleLerpFunctor::operator=(const qpColorScaleLerpFunctor& c) { +ColorScaleLerpFunctor& ColorScaleLerpFunctor::operator=(const ColorScaleLerpFunctor& c) { _node_path = c._node_path; LVecBase4fLerpFunctor::operator=(c); return *this; } -void qpColorScaleLerpFunctor::operator()(float t) { +void ColorScaleLerpFunctor::operator()(float t) { _node_path.set_color_scale(interpolate(t)); } diff --git a/panda/src/pgraph/qpnodePathLerps.h b/panda/src/pgraph/nodePathLerps.h similarity index 70% rename from panda/src/pgraph/qpnodePathLerps.h rename to panda/src/pgraph/nodePathLerps.h index c4d7213c6d..bc717e711e 100644 --- a/panda/src/pgraph/qpnodePathLerps.h +++ b/panda/src/pgraph/nodePathLerps.h @@ -1,4 +1,4 @@ -// Filename: qpnodePathLerps.h +// Filename: nodePathLerps.h // Created by: frang (01Jun00) // //////////////////////////////////////////////////////////////////// @@ -16,43 +16,43 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpNODEPATHLERPS_H -#define qpNODEPATHLERPS_H +#ifndef NODEPATHLERPS_H +#define NODEPATHLERPS_H #include "pandabase.h" #include "lerpfunctor.h" -#include "qpnodePath.h" +#include "nodePath.h" //////////////////////////////////////////////////////////////////// // Class : PosLerpFunctor // Description : Class for Lerping between positions in space //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPosLerpFunctor : public LPoint3fLerpFunctor { +class EXPCL_PANDA PosLerpFunctor : public LPoint3fLerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpPosLerpFunctor(qpNodePath np, LPoint3f start, LPoint3f end) + PosLerpFunctor(NodePath np, LPoint3f start, LPoint3f end) : LPoint3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} - qpPosLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, float ey, + PosLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, float ez) : LPoint3fLerpFunctor(LPoint3f(sx, sy, sz), LPoint3f(ex, ey, ez)), _node_path(np), _is_wrt(false) {} - qpPosLerpFunctor(qpNodePath np, LPoint3f start, LPoint3f end, qpNodePath wrt) + PosLerpFunctor(NodePath np, LPoint3f start, LPoint3f end, NodePath wrt) : LPoint3fLerpFunctor(start, end), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} - qpPosLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, float ey, - float ez, qpNodePath wrt) + PosLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, + float ez, NodePath wrt) : LPoint3fLerpFunctor(LPoint3f(sx, sy, sz), LPoint3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} public: - qpPosLerpFunctor(const qpPosLerpFunctor&); - virtual ~qpPosLerpFunctor(void); - qpPosLerpFunctor& operator=(const qpPosLerpFunctor&); + PosLerpFunctor(const PosLerpFunctor&); + virtual ~PosLerpFunctor(void); + PosLerpFunctor& operator=(const PosLerpFunctor&); virtual void operator()(float); public: @@ -62,7 +62,7 @@ public: } static void init_type(void) { LPoint3fLerpFunctor::init_type(); - register_type(_type_handle, "qpPosLerpFunctor", + register_type(_type_handle, "PosLerpFunctor", LPoint3fLerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -82,33 +82,33 @@ private: // Class : HprLerpFunctor // Description : Class for Lerping between orientations in space //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpHprLerpFunctor : public LVecBase3fLerpFunctor { +class EXPCL_PANDA HprLerpFunctor : public LVecBase3fLerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpHprLerpFunctor(qpNodePath np, LVecBase3f start, LVecBase3f end) + HprLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} - qpHprLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, float ey, + HprLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, float ez) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(false) {} - qpHprLerpFunctor(qpNodePath np, LVecBase3f start, LVecBase3f end, qpNodePath wrt) + HprLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end, NodePath wrt) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} - qpHprLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, float ey, - float ez, qpNodePath wrt) + HprLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, + float ez, NodePath wrt) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} void take_shortest(void); void take_longest(void); public: - qpHprLerpFunctor(const qpHprLerpFunctor&); - virtual ~qpHprLerpFunctor(void); - qpHprLerpFunctor& operator=(const qpHprLerpFunctor&); + HprLerpFunctor(const HprLerpFunctor&); + virtual ~HprLerpFunctor(void); + HprLerpFunctor& operator=(const HprLerpFunctor&); virtual void operator()(float); public: @@ -118,7 +118,7 @@ public: } static void init_type(void) { LVecBase3fLerpFunctor::init_type(); - register_type(_type_handle, "qpHprLerpFunctor", + register_type(_type_handle, "HprLerpFunctor", LVecBase3fLerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -133,34 +133,34 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpScaleLerpFunctor +// Class : ScaleLerpFunctor // Description : Class for Lerping between scales //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpScaleLerpFunctor : public LVecBase3fLerpFunctor { +class EXPCL_PANDA ScaleLerpFunctor : public LVecBase3fLerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpScaleLerpFunctor(qpNodePath np, LVecBase3f start, LVecBase3f end) + ScaleLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} - qpScaleLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, + ScaleLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, float ez) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(false) {} - qpScaleLerpFunctor(qpNodePath np, LVecBase3f start, LVecBase3f end, qpNodePath wrt) + ScaleLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end, NodePath wrt) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} - qpScaleLerpFunctor(qpNodePath np, float sx, float sy, float sz, float ex, - float ey, float ez, qpNodePath wrt) + ScaleLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, + float ey, float ez, NodePath wrt) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} public: - qpScaleLerpFunctor(const qpScaleLerpFunctor&); - virtual ~qpScaleLerpFunctor(void); - qpScaleLerpFunctor& operator=(const qpScaleLerpFunctor&); + ScaleLerpFunctor(const ScaleLerpFunctor&); + virtual ~ScaleLerpFunctor(void); + ScaleLerpFunctor& operator=(const ScaleLerpFunctor&); virtual void operator()(float); public: @@ -170,7 +170,7 @@ public: } static void init_type(void) { LVecBase3fLerpFunctor::init_type(); - register_type(_type_handle, "qpScaleLerpFunctor", + register_type(_type_handle, "ScaleLerpFunctor", LVecBase3fLerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -185,33 +185,33 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpColorLerpFunctor +// Class : ColorLerpFunctor // Description : Class for Lerping between colors //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpColorLerpFunctor : public LVecBase4fLerpFunctor { +class EXPCL_PANDA ColorLerpFunctor : public LVecBase4fLerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpColorLerpFunctor(qpNodePath np, LVecBase4f start, LVecBase4f end) + ColorLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} - qpColorLerpFunctor(qpNodePath np, float sr, float sg, float sb, float sa, + ColorLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg, float eb, float ea) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(false) {} - qpColorLerpFunctor(qpNodePath np, LVecBase4f start, LVecBase4f end, qpNodePath wrt) + ColorLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end, NodePath wrt) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} - qpColorLerpFunctor(qpNodePath np, float sr, float sg, float sb, float sa, float er, float eg, - float eb, float ea, qpNodePath wrt) + ColorLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg, + float eb, float ea, NodePath wrt) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} public: - qpColorLerpFunctor(const qpColorLerpFunctor&); - virtual ~qpColorLerpFunctor(void); - qpColorLerpFunctor& operator=(const qpColorLerpFunctor&); + ColorLerpFunctor(const ColorLerpFunctor&); + virtual ~ColorLerpFunctor(void); + ColorLerpFunctor& operator=(const ColorLerpFunctor&); virtual void operator()(float); public: @@ -221,7 +221,7 @@ public: } static void init_type(void) { LVecBase4fLerpFunctor::init_type(); - register_type(_type_handle, "qpColorLerpFunctor", + register_type(_type_handle, "ColorLerpFunctor", LVecBase4fLerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -236,13 +236,13 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpPosHprLerpFunctor +// Class : PosHprLerpFunctor // Description : Class for Lerping between positions and orientations // in space //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPosHprLerpFunctor : public LerpFunctor { +class EXPCL_PANDA PosHprLerpFunctor : public LerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; LPoint3f _pstart; LPoint3f _pend; LPoint3f _pdiff_cache; @@ -250,29 +250,29 @@ private: LVecBase3f _hend; LVecBase3f _hdiff_cache; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpPosHprLerpFunctor(qpNodePath np, LPoint3f pstart, LPoint3f pend, + PosHprLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, LVecBase3f hstart, LVecBase3f hend) : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend), _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _is_wrt(false) {} - qpPosHprLerpFunctor(qpNodePath np, float psx, float psy, float psz, float pex, + PosHprLerpFunctor(NodePath np, float psx, float psy, float psz, float pex, float pey, float pez, float hsx, float hsy, float hsz, float hex, float hey, float hez) : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz), _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), _hdiff_cache(_hend - _hstart), _is_wrt(false) {} - qpPosHprLerpFunctor(qpNodePath np, LPoint3f pstart, LPoint3f pend, - LVecBase3f hstart, LVecBase3f hend, qpNodePath wrt) + PosHprLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, + LVecBase3f hstart, LVecBase3f hend, NodePath wrt) : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend), _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _is_wrt(true), _wrt_path(wrt) {} - qpPosHprLerpFunctor(qpNodePath np, float psx, float psy, float psz, float pex, + PosHprLerpFunctor(NodePath np, float psx, float psy, float psz, float pex, float pey, float pez, float hsx, float hsy, float hsz, - float hex, float hey, float hez, qpNodePath wrt) + float hex, float hey, float hez, NodePath wrt) : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz), _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), @@ -281,9 +281,9 @@ PUBLISHED: void take_longest(void); public: - qpPosHprLerpFunctor(const qpPosHprLerpFunctor&); - virtual ~qpPosHprLerpFunctor(void); - qpPosHprLerpFunctor& operator=(const qpPosHprLerpFunctor&); + PosHprLerpFunctor(const PosHprLerpFunctor&); + virtual ~PosHprLerpFunctor(void); + PosHprLerpFunctor& operator=(const PosHprLerpFunctor&); virtual void operator()(float); public: @@ -293,7 +293,7 @@ public: } static void init_type(void) { LerpFunctor::init_type(); - register_type(_type_handle, "qpPosHprLerpFunctor", + register_type(_type_handle, "PosHprLerpFunctor", LerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -308,13 +308,13 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpHprScaleLerpFunctor +// Class : HprScaleLerpFunctor // Description : Class for Lerping between orientation // and scale //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpHprScaleLerpFunctor : public LerpFunctor { +class EXPCL_PANDA HprScaleLerpFunctor : public LerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; LVecBase3f _hstart; LVecBase3f _hend; LVecBase3f _hdiff_cache; @@ -322,33 +322,33 @@ private: LVecBase3f _send; LVecBase3f _sdiff_cache; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpHprScaleLerpFunctor(qpNodePath np, + HprScaleLerpFunctor(NodePath np, LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart, LVecBase3f send) : LerpFunctor(), _node_path(np), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _sstart(sstart), _send(send), _sdiff_cache(send-sstart), _is_wrt(false) {} - qpHprScaleLerpFunctor(qpNodePath np, float hsx, float hsy, + HprScaleLerpFunctor(NodePath np, float hsx, float hsy, float hsz, float hex, float hey, float hez, float ssx, float ssy, float ssz, float sex, float sey, float sez) : LerpFunctor(), _node_path(np), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz), _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(false) {} - qpHprScaleLerpFunctor(qpNodePath np, + HprScaleLerpFunctor(NodePath np, LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart, - LVecBase3f send, qpNodePath wrt) + LVecBase3f send, NodePath wrt) : LerpFunctor(), _node_path(np), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _sstart(sstart), _send(send), _sdiff_cache(send-sstart), _is_wrt(true), _wrt_path(wrt) {} - qpHprScaleLerpFunctor(qpNodePath np, float hsx, float hsy, + HprScaleLerpFunctor(NodePath np, float hsx, float hsy, float hsz, float hex, float hey, float hez, float ssx, float ssy, float ssz, float sex, float sey, float sez, - qpNodePath wrt) + NodePath wrt) : LerpFunctor(), _node_path(np), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz), @@ -358,9 +358,9 @@ PUBLISHED: void take_longest(void); public: - qpHprScaleLerpFunctor(const qpHprScaleLerpFunctor&); - virtual ~qpHprScaleLerpFunctor(void); - qpHprScaleLerpFunctor& operator=(const qpHprScaleLerpFunctor&); + HprScaleLerpFunctor(const HprScaleLerpFunctor&); + virtual ~HprScaleLerpFunctor(void); + HprScaleLerpFunctor& operator=(const HprScaleLerpFunctor&); virtual void operator()(float); public: @@ -370,7 +370,7 @@ public: } static void init_type(void) { LerpFunctor::init_type(); - register_type(_type_handle, "qpHprScaleLerpFunctor", + register_type(_type_handle, "HprScaleLerpFunctor", LerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -385,13 +385,13 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpPosHprScaleLerpFunctor +// Class : PosHprScaleLerpFunctor // Description : Class for Lerping between position, orientation, // and scale //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPosHprScaleLerpFunctor : public LerpFunctor { +class EXPCL_PANDA PosHprScaleLerpFunctor : public LerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; LPoint3f _pstart; LPoint3f _pend; LPoint3f _pdiff_cache; @@ -402,17 +402,17 @@ private: LVecBase3f _send; LVecBase3f _sdiff_cache; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpPosHprScaleLerpFunctor(qpNodePath np, LPoint3f pstart, LPoint3f pend, + PosHprScaleLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart, LVecBase3f send) : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend), _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _sstart(sstart), _send(send), _sdiff_cache(send-sstart), _is_wrt(false) {} - qpPosHprScaleLerpFunctor(qpNodePath np, float psx, float psy, float psz, + PosHprScaleLerpFunctor(NodePath np, float psx, float psy, float psz, float pex, float pey, float pez, float hsx, float hsy, float hsz, float hex, float hey, float hez, float ssx, float ssy, float ssz, float sex, float sey, float sez) @@ -421,18 +421,18 @@ PUBLISHED: _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz), _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(false) {} - qpPosHprScaleLerpFunctor(qpNodePath np, LPoint3f pstart, LPoint3f pend, + PosHprScaleLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart, - LVecBase3f send, qpNodePath wrt) + LVecBase3f send, NodePath wrt) : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend), _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend), _hdiff_cache(hend-hstart), _sstart(sstart), _send(send), _sdiff_cache(send-sstart), _is_wrt(true), _wrt_path(wrt) {} - qpPosHprScaleLerpFunctor(qpNodePath np, float psx, float psy, float psz, + PosHprScaleLerpFunctor(NodePath np, float psx, float psy, float psz, float pex, float pey, float pez, float hsx, float hsy, float hsz, float hex, float hey, float hez, float ssx, float ssy, float ssz, float sex, float sey, float sez, - qpNodePath wrt) + NodePath wrt) : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz), _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), @@ -443,9 +443,9 @@ PUBLISHED: void take_longest(void); public: - qpPosHprScaleLerpFunctor(const qpPosHprScaleLerpFunctor&); - virtual ~qpPosHprScaleLerpFunctor(void); - qpPosHprScaleLerpFunctor& operator=(const qpPosHprScaleLerpFunctor&); + PosHprScaleLerpFunctor(const PosHprScaleLerpFunctor&); + virtual ~PosHprScaleLerpFunctor(void); + PosHprScaleLerpFunctor& operator=(const PosHprScaleLerpFunctor&); virtual void operator()(float); public: @@ -455,7 +455,7 @@ public: } static void init_type(void) { LerpFunctor::init_type(); - register_type(_type_handle, "qpPosHprScaleLerpFunctor", + register_type(_type_handle, "PosHprScaleLerpFunctor", LerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -470,33 +470,33 @@ private: }; //////////////////////////////////////////////////////////////////// -// Class : qpColorScaleLerpFunctor +// Class : ColorScaleLerpFunctor // Description : Class for Lerping between color scales //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpColorScaleLerpFunctor : public LVecBase4fLerpFunctor { +class EXPCL_PANDA ColorScaleLerpFunctor : public LVecBase4fLerpFunctor { private: - qpNodePath _node_path; + NodePath _node_path; bool _is_wrt; - qpNodePath _wrt_path; + NodePath _wrt_path; PUBLISHED: - qpColorScaleLerpFunctor(qpNodePath np, LVecBase4f start, LVecBase4f end) + ColorScaleLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} - qpColorScaleLerpFunctor(qpNodePath np, float sr, float sg, float sb, float sa, + ColorScaleLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg, float eb, float ea) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(false) {} - qpColorScaleLerpFunctor(qpNodePath np, LVecBase4f start, LVecBase4f end, qpNodePath wrt) + ColorScaleLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end, NodePath wrt) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} - qpColorScaleLerpFunctor(qpNodePath np, float sr, float sg, float sb, float sa, float er, float eg, - float eb, float ea, qpNodePath wrt) + ColorScaleLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg, + float eb, float ea, NodePath wrt) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} public: - qpColorScaleLerpFunctor(const qpColorScaleLerpFunctor&); - virtual ~qpColorScaleLerpFunctor(void); - qpColorScaleLerpFunctor& operator=(const qpColorScaleLerpFunctor&); + ColorScaleLerpFunctor(const ColorScaleLerpFunctor&); + virtual ~ColorScaleLerpFunctor(void); + ColorScaleLerpFunctor& operator=(const ColorScaleLerpFunctor&); virtual void operator()(float); public: @@ -506,7 +506,7 @@ public: } static void init_type(void) { LVecBase4fLerpFunctor::init_type(); - register_type(_type_handle, "qpColorScaleLerpFunctor", + register_type(_type_handle, "ColorScaleLerpFunctor", LVecBase4fLerpFunctor::get_class_type()); } virtual TypeHandle get_type(void) const { @@ -520,7 +520,7 @@ private: static TypeHandle _type_handle; }; -#endif /* qpNODEPATHLERPS_H */ +#endif /* NODEPATHLERPS_H */ diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 893f51d235..f4c2e4f9ee 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -18,7 +18,7 @@ #include "pandaNode.h" #include "config_pgraph.h" -#include "qpnodePathComponent.h" +#include "nodePathComponent.h" #include "bamReader.h" #include "bamWriter.h" #include "indent.h" @@ -586,7 +586,7 @@ has_cull_callback() const { // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// bool PandaNode:: -cull_callback(qpCullTraverser *, CullTraverserData &) { +cull_callback(CullTraverser *, CullTraverserData &) { return true; } @@ -1380,19 +1380,19 @@ r_copy_children(const PandaNode *from, PandaNode::InstanceMap &inst_map) { // Function: PandaNode::attach // Access: Private, Static // Description: Creates a new parent-child relationship, and returns -// the new qpNodePathComponent. If the child was already +// the new NodePathComponent. If the child was already // attached to the indicated parent, repositions it and -// returns the original qpNodePathComponent. +// returns the original NodePathComponent. //////////////////////////////////////////////////////////////////// -PT(qpNodePathComponent) PandaNode:: -attach(qpNodePathComponent *parent, PandaNode *child_node, int sort) { - nassertr(parent != (qpNodePathComponent *)NULL, (qpNodePathComponent *)NULL); +PT(NodePathComponent) PandaNode:: +attach(NodePathComponent *parent, PandaNode *child_node, int sort) { + nassertr(parent != (NodePathComponent *)NULL, (NodePathComponent *)NULL); // See if the child was already attached to the parent. If it was, - // we'll use that same qpNodePathComponent. - PT(qpNodePathComponent) child = get_component(parent, child_node); + // we'll use that same NodePathComponent. + PT(NodePathComponent) child = get_component(parent, child_node); - if (child == (qpNodePathComponent *)NULL) { + if (child == (NodePathComponent *)NULL) { // The child was not already attached to the parent, so get a new // component. child = get_top_component(child_node, true); @@ -1408,15 +1408,15 @@ attach(qpNodePathComponent *parent, PandaNode *child_node, int sort) { // Description: Breaks a parent-child relationship. //////////////////////////////////////////////////////////////////// void PandaNode:: -detach(qpNodePathComponent *child) { - nassertv(child != (qpNodePathComponent *)NULL); +detach(NodePathComponent *child) { + nassertv(child != (NodePathComponent *)NULL); nassertv(!child->is_top_node()); PT(PandaNode) child_node = child->get_node(); PT(PandaNode) parent_node = child->get_next()->get_node(); // We should actually have a parent-child relationship, since this - // came from a qpNodePathComponent that ought to know about this + // came from a NodePathComponent that ought to know about this // sort of thing. nassertv(child_node->find_parent(parent_node) >= 0); @@ -1470,15 +1470,15 @@ detach(qpNodePathComponent *child) { // Description: Switches a node from one parent to another. //////////////////////////////////////////////////////////////////// void PandaNode:: -reparent(qpNodePathComponent *new_parent, qpNodePathComponent *child, int sort) { - nassertv(new_parent != (qpNodePathComponent *)NULL); - nassertv(child != (qpNodePathComponent *)NULL); +reparent(NodePathComponent *new_parent, NodePathComponent *child, int sort) { + nassertv(new_parent != (NodePathComponent *)NULL); + nassertv(child != (NodePathComponent *)NULL); if (!child->is_top_node()) { detach(child); } - // Adjust the qpNodePathComponents. + // Adjust the NodePathComponents. child->set_next(new_parent); PandaNode *child_node = child->get_node(); @@ -1505,19 +1505,19 @@ reparent(qpNodePathComponent *new_parent, qpNodePathComponent *child, int sort) //////////////////////////////////////////////////////////////////// // Function: PandaNode::get_component // Access: Private, Static -// Description: Returns the qpNodePathComponent based on the indicated +// Description: Returns the NodePathComponent based on the indicated // child of the given parent, or NULL if there is no // such parent-child relationship. //////////////////////////////////////////////////////////////////// -PT(qpNodePathComponent) PandaNode:: -get_component(qpNodePathComponent *parent, PandaNode *child_node) { - nassertr(parent != (qpNodePathComponent *)NULL, (qpNodePathComponent *)NULL); +PT(NodePathComponent) PandaNode:: +get_component(NodePathComponent *parent, PandaNode *child_node) { + nassertr(parent != (NodePathComponent *)NULL, (NodePathComponent *)NULL); PandaNode *parent_node = parent->get_node(); { CDReader cdata_child(child_node->_cycler); - // First, walk through the list of qpNodePathComponents we already + // First, walk through the list of NodePathComponents we already // have on the child, looking for one that already exists, // referencing the indicated parent component. Paths::const_iterator pi; @@ -1531,13 +1531,13 @@ get_component(qpNodePathComponent *parent, PandaNode *child_node) { } } - // We don't already have a qpNodePathComponent referring to this + // We don't already have a NodePathComponent referring to this // parent-child relationship. Are they actually related? int child_index = child_node->find_parent(parent_node); if (child_index >= 0) { // They are. Create and return a new one. - PT(qpNodePathComponent) child = - new qpNodePathComponent(child_node, parent); + PT(NodePathComponent) child = + new NodePathComponent(child_node, parent); CDWriter cdata_child(child_node->_cycler); cdata_child->_paths.insert(child); return child; @@ -1550,23 +1550,23 @@ get_component(qpNodePathComponent *parent, PandaNode *child_node) { //////////////////////////////////////////////////////////////////// // Function: PandaNode::get_top_component // Access: Private, Static -// Description: Returns a qpNodePathComponent referencing the +// Description: Returns a NodePathComponent referencing the // indicated node as a singleton. It is invalid to call // this for a node that has parents, unless you are // about to create a new instance (and immediately -// reconnect the qpNodePathComponent elsewhere). +// reconnect the NodePathComponent elsewhere). // // If force is true, this will always return something, // even if it needs to create a new top component; // otherwise, if force is false, it will return NULL if // there is not already a top component available. //////////////////////////////////////////////////////////////////// -PT(qpNodePathComponent) PandaNode:: +PT(NodePathComponent) PandaNode:: get_top_component(PandaNode *child_node, bool force) { { CDReader cdata_child(child_node->_cycler); - // Walk through the list of qpNodePathComponents we already have on + // Walk through the list of NodePathComponents we already have on // the child, looking for one that already exists as a top node. Paths::const_iterator pi; for (pi = cdata_child->_paths.begin(); @@ -1585,10 +1585,10 @@ get_top_component(PandaNode *child_node, bool force) { return NULL; } - // We don't already have such a qpNodePathComponent; create and + // We don't already have such a NodePathComponent; create and // return a new one. - PT(qpNodePathComponent) child = - new qpNodePathComponent(child_node, (qpNodePathComponent *)NULL); + PT(NodePathComponent) child = + new NodePathComponent(child_node, (NodePathComponent *)NULL); CDWriter cdata_child(child_node->_cycler); cdata_child->_paths.insert(child); @@ -1598,7 +1598,7 @@ get_top_component(PandaNode *child_node, bool force) { //////////////////////////////////////////////////////////////////// // Function: PandaNode::get_generic_component // Access: Private -// Description: Returns a qpNodePathComponent referencing this node as +// Description: Returns a NodePathComponent referencing this node as // a path from the root. // // Unless accept_ambiguity is true, it is only valid to @@ -1606,7 +1606,7 @@ get_top_component(PandaNode *child_node, bool force) { // root; otherwise, a warning will be issued and one // path will be chosen arbitrarily. //////////////////////////////////////////////////////////////////// -PT(qpNodePathComponent) PandaNode:: +PT(NodePathComponent) PandaNode:: get_generic_component(bool accept_ambiguity) { int num_parents = get_num_parents(); if (num_parents == 0) { @@ -1614,10 +1614,10 @@ get_generic_component(bool accept_ambiguity) { return get_top_component(this, true); } - PT(qpNodePathComponent) result; + PT(NodePathComponent) result; if (num_parents == 1) { // Only one parent; no ambiguity. - PT(qpNodePathComponent) parent = + PT(NodePathComponent) parent = get_parent(0)->get_generic_component(accept_ambiguity); result = get_component(parent, this); @@ -1629,7 +1629,7 @@ get_generic_component(bool accept_ambiguity) { << " parents; choosing arbitrary path to root.\n"; } - PT(qpNodePathComponent) parent = + PT(NodePathComponent) parent = get_parent(0)->get_generic_component(accept_ambiguity); result = get_component(parent, this); nassertr(accept_ambiguity || !unambiguous_graph, result); @@ -1641,12 +1641,12 @@ get_generic_component(bool accept_ambiguity) { //////////////////////////////////////////////////////////////////// // Function: PandaNode::delete_component // Access: Private -// Description: Removes a qpNodePathComponent from the set prior to +// Description: Removes a NodePathComponent from the set prior to // its deletion. This should only be called by the -// qpNodePathComponent destructor. +// NodePathComponent destructor. //////////////////////////////////////////////////////////////////// void PandaNode:: -delete_component(qpNodePathComponent *component) { +delete_component(NodePathComponent *component) { // We have to remove the component from all of the pipeline stages, // not just the current one. int max_num_erased = 0; @@ -1682,7 +1682,7 @@ delete_component(qpNodePathComponent *component) { void PandaNode:: sever_connection(PandaNode *parent_node, PandaNode *child_node) { CDWriter cdata_child(child_node->_cycler); - PT(qpNodePathComponent) collapsed = (qpNodePathComponent *)NULL; + PT(NodePathComponent) collapsed = (NodePathComponent *)NULL; Paths::iterator pi; pi = cdata_child->_paths.begin(); @@ -1691,7 +1691,7 @@ sever_connection(PandaNode *parent_node, PandaNode *child_node) { ++pnext; if (!(*pi)->is_top_node() && (*pi)->get_next()->get_node() == parent_node) { - if (collapsed == (qpNodePathComponent *)NULL) { + if (collapsed == (NodePathComponent *)NULL) { // This is the first component we've found that references // this node. Should we sever it or reattach it? @@ -1710,7 +1710,7 @@ sever_connection(PandaNode *parent_node, PandaNode *child_node) { collapsed = child_node->get_generic_component(true); } - if (collapsed == (qpNodePathComponent *)NULL) { + if (collapsed == (NodePathComponent *)NULL) { // Sever the component here; there's nothing to attach it // to. (*pi)->set_top_node(); @@ -1767,7 +1767,7 @@ new_connection(PandaNode *parent_node, PandaNode *child_node) { // Function: PandaNode::fix_path_lengths // Access: Private // Description: Recursively fixes the _length member of each -// qpNodePathComponent at this level and below, after an +// NodePathComponent at this level and below, after an // add or delete child operation that might have messed // these up. //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 117027ad92..45c876d8c1 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -40,10 +40,11 @@ #include "pointerToArray.h" #include "notify.h" -class qpNodePathComponent; -class qpCullTraverser; +class NodePathComponent; +class CullTraverser; class CullTraverserData; class Light; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : PandaNode @@ -74,7 +75,7 @@ public: virtual PandaNode *combine_with(PandaNode *other); virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual bool has_selective_visibility() const; virtual int get_first_visible_child() const; virtual int get_next_visible_child(int n) const; @@ -191,19 +192,19 @@ protected: private: class CData; - // parent-child manipulation for qpNodePath support. Don't try to + // parent-child manipulation for NodePath support. Don't try to // call these directly. - static PT(qpNodePathComponent) attach(qpNodePathComponent *parent, + static PT(NodePathComponent) attach(NodePathComponent *parent, PandaNode *child, int sort); - static void detach(qpNodePathComponent *child); - static void reparent(qpNodePathComponent *new_parent, - qpNodePathComponent *child, int sort); - static PT(qpNodePathComponent) get_component(qpNodePathComponent *parent, + static void detach(NodePathComponent *child); + static void reparent(NodePathComponent *new_parent, + NodePathComponent *child, int sort); + static PT(NodePathComponent) get_component(NodePathComponent *parent, PandaNode *child); - static PT(qpNodePathComponent) get_top_component(PandaNode *child, + static PT(NodePathComponent) get_top_component(PandaNode *child, bool force); - PT(qpNodePathComponent) get_generic_component(bool accept_ambiguity); - void delete_component(qpNodePathComponent *component); + PT(NodePathComponent) get_generic_component(bool accept_ambiguity); + void delete_component(NodePathComponent *component); static void sever_connection(PandaNode *parent_node, PandaNode *child_node); static void new_connection(PandaNode *parent_node, PandaNode *child_node); void fix_path_lengths(const CData *cdata); @@ -240,12 +241,12 @@ private: }; typedef ov_set Up; - // We also maintain a set of qpNodePathComponents in the node. This + // We also maintain a set of NodePathComponents in the node. This // represents the set of instances of this node that we have - // requested a qpNodePath for. We don't keep reference counts; when - // each qpNodePathComponent destructs, it removes itself from this + // requested a NodePath for. We don't keep reference counts; when + // each NodePathComponent destructs, it removes itself from this // set. - typedef pset Paths; + typedef pset Paths; // This is the data that must be cycled between pipeline stages. class EXPCL_PANDA CData : public CycleData { @@ -363,8 +364,8 @@ private: static TypeHandle _type_handle; friend class PandaNode::Children; - friend class qpNodePath; - friend class qpNodePathComponent; + friend class NodePath; + friend class NodePathComponent; friend class WorkingNodePath; }; diff --git a/panda/src/pgraph/pgraph_composite1.cxx b/panda/src/pgraph/pgraph_composite1.cxx index 77254c0dbe..877818d8c9 100644 --- a/panda/src/pgraph/pgraph_composite1.cxx +++ b/panda/src/pgraph/pgraph_composite1.cxx @@ -1,7 +1,7 @@ #include "ambientLight.cxx" #include "billboardEffect.cxx" #include "binCullHandler.cxx" -#include "qpcamera.cxx" +#include "camera.cxx" #include "colorAttrib.cxx" #include "colorBlendAttrib.cxx" #include "colorScaleAttrib.cxx" @@ -15,7 +15,7 @@ #include "cullFaceAttrib.cxx" #include "cullHandler.cxx" #include "cullResult.cxx" -#include "qpcullTraverser.cxx" +#include "cullTraverser.cxx" #include "cullTraverserData.cxx" #include "cullableObject.cxx" #include "decalEffect.cxx" @@ -24,10 +24,10 @@ #include "depthWriteAttrib.cxx" #include "directionalLight.cxx" #include "drawCullHandler.cxx" -#include "qpfindApproxPath.cxx" -#include "qpfindApproxLevel.cxx" -#include "qpfindApproxLevelEntry.cxx" -#include "qpfog.cxx" +#include "findApproxPath.cxx" +#include "findApproxLevel.cxx" +#include "findApproxLevelEntry.cxx" +#include "fog.cxx" #include "fogAttrib.cxx" -#include "qpgeomNode.cxx" -#include "qpgeomTransformer.cxx" +#include "geomNode.cxx" +#include "geomTransformer.cxx" diff --git a/panda/src/pgraph/pgraph_composite2.cxx b/panda/src/pgraph/pgraph_composite2.cxx index d6597886c3..cc3088f1b4 100644 --- a/panda/src/pgraph/pgraph_composite2.cxx +++ b/panda/src/pgraph/pgraph_composite2.cxx @@ -1,15 +1,15 @@ -#include "qplensNode.cxx" +#include "lensNode.cxx" #include "light.cxx" #include "lightAttrib.cxx" #include "lightLensNode.cxx" #include "lightNode.cxx" -#include "qplodNode.cxx" +#include "lodNode.cxx" #include "materialAttrib.cxx" -#include "qpmodelNode.cxx" -#include "qpmodelRoot.cxx" -#include "qpnodePathCollection.cxx" -#include "qpnodePathComponent.cxx" -#include "qpnodePathLerps.cxx" +#include "modelNode.cxx" +#include "modelRoot.cxx" +#include "nodePathCollection.cxx" +#include "nodePathComponent.cxx" +#include "nodePathLerps.cxx" #include "pandaNode.cxx" #include "pointLight.cxx" #include "renderAttrib.cxx" @@ -18,9 +18,9 @@ #include "renderModeAttrib.cxx" #include "renderState.cxx" #include "sceneGraphAnalyzer.cxx" -#include "qpsceneGraphReducer.cxx" +#include "sceneGraphReducer.cxx" #include "selectiveChildNode.cxx" -#include "qpsequenceNode.cxx" +#include "sequenceNode.cxx" #include "showBoundsEffect.cxx" #include "spotlight.cxx" #include "test_pgraph.cxx" diff --git a/panda/src/pgraph/renderEffects.h b/panda/src/pgraph/renderEffects.h index e82f11a91e..22ab9201f9 100644 --- a/panda/src/pgraph/renderEffects.h +++ b/panda/src/pgraph/renderEffects.h @@ -28,6 +28,7 @@ #include "ordered_vector.h" class BillboardEffect; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : RenderEffects diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index 3a8118620c..21a1b4fbdc 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -30,6 +30,7 @@ class GraphicsStateGuardianBase; class FogAttrib; class TransparencyAttrib; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : RenderState diff --git a/panda/src/pgraph/sceneGraphAnalyzer.cxx b/panda/src/pgraph/sceneGraphAnalyzer.cxx index 7822d6b02d..9faa71ef7f 100644 --- a/panda/src/pgraph/sceneGraphAnalyzer.cxx +++ b/panda/src/pgraph/sceneGraphAnalyzer.cxx @@ -20,7 +20,7 @@ #include "config_pgraph.h" #include "indent.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "geom.h" #include "geomprimitives.h" #include "transformState.h" @@ -211,7 +211,7 @@ collect_statistics(PandaNode *node, bool under_instance) { } if (node->is_geom_node()) { - collect_statistics(DCAST(qpGeomNode, node)); + collect_statistics(DCAST(GeomNode, node)); } int num_children = node->get_num_children(); @@ -228,8 +228,8 @@ collect_statistics(PandaNode *node, bool under_instance) { // statistics. //////////////////////////////////////////////////////////////////// void SceneGraphAnalyzer:: -collect_statistics(qpGeomNode *geom_node) { - nassertv(geom_node != (qpGeomNode *)NULL); +collect_statistics(GeomNode *geom_node) { + nassertv(geom_node != (GeomNode *)NULL); _num_geom_nodes++; diff --git a/panda/src/pgraph/sceneGraphAnalyzer.h b/panda/src/pgraph/sceneGraphAnalyzer.h index 98c8116cf3..d452cfd203 100644 --- a/panda/src/pgraph/sceneGraphAnalyzer.h +++ b/panda/src/pgraph/sceneGraphAnalyzer.h @@ -27,7 +27,7 @@ #include "pmap.h" class PandaNode; -class qpGeomNode; +class GeomNode; class Geom; class Texture; @@ -48,7 +48,7 @@ public: private: void collect_statistics(PandaNode *node, bool under_instance); - void collect_statistics(qpGeomNode *geom_node); + void collect_statistics(GeomNode *geom_node); void collect_statistics(Geom *geom); void collect_statistics(Texture *texture); diff --git a/panda/src/pgraph/qpsceneGraphReducer.I b/panda/src/pgraph/sceneGraphReducer.I similarity index 73% rename from panda/src/pgraph/qpsceneGraphReducer.I rename to panda/src/pgraph/sceneGraphReducer.I index 3e36cbbbd5..78801e3bc6 100644 --- a/panda/src/pgraph/qpsceneGraphReducer.I +++ b/panda/src/pgraph/sceneGraphReducer.I @@ -1,4 +1,4 @@ -// Filename: qpsceneGraphReducer.I +// Filename: sceneGraphReducer.I // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,21 +18,21 @@ //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::Constructor +// Function: SceneGraphReducer::AccumulatedAttribs::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpSceneGraphReducer::AccumulatedAttribs:: +INLINE SceneGraphReducer::AccumulatedAttribs:: AccumulatedAttribs() { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::Copy Constructor +// Function: SceneGraphReducer::AccumulatedAttribs::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpSceneGraphReducer::AccumulatedAttribs:: -AccumulatedAttribs(const qpSceneGraphReducer::AccumulatedAttribs ©) : +INLINE SceneGraphReducer::AccumulatedAttribs:: +AccumulatedAttribs(const SceneGraphReducer::AccumulatedAttribs ©) : _transform(copy._transform), _color(copy._color), _color_scale(copy._color_scale), @@ -42,12 +42,12 @@ AccumulatedAttribs(const qpSceneGraphReducer::AccumulatedAttribs ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::Copy Assignment +// Function: SceneGraphReducer::AccumulatedAttribs::Copy Assignment // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpSceneGraphReducer::AccumulatedAttribs:: -operator = (const qpSceneGraphReducer::AccumulatedAttribs ©) { +INLINE void SceneGraphReducer::AccumulatedAttribs:: +operator = (const SceneGraphReducer::AccumulatedAttribs ©) { _transform = copy._transform; _color = copy._color; _color_scale = copy._color_scale; diff --git a/panda/src/pgraph/qpsceneGraphReducer.cxx b/panda/src/pgraph/sceneGraphReducer.cxx similarity index 93% rename from panda/src/pgraph/qpsceneGraphReducer.cxx rename to panda/src/pgraph/sceneGraphReducer.cxx index c8ce5bb612..74d90a741e 100644 --- a/panda/src/pgraph/qpsceneGraphReducer.cxx +++ b/panda/src/pgraph/sceneGraphReducer.cxx @@ -1,4 +1,4 @@ -// Filename: qpqpSceneGraphReducer.cxx +// Filename: SceneGraphReducer.cxx // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,24 +16,24 @@ // //////////////////////////////////////////////////////////////////// -#include "qpsceneGraphReducer.h" +#include "sceneGraphReducer.h" #include "config_pgraph.h" #include "colorAttrib.h" #include "texMatrixAttrib.h" #include "colorScaleAttrib.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "pointerTo.h" #include "geom.h" #include "indent.h" #include "plist.h" //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::write +// Function: SceneGraphReducer::AccumulatedAttribs::write // Access: Public // Description: //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer::AccumulatedAttribs:: +void SceneGraphReducer::AccumulatedAttribs:: write(ostream &out, int attrib_types, int indent_level) const { if ((attrib_types & TT_transform) != 0) { _transform->write(out, indent_level); @@ -65,13 +65,13 @@ write(ostream &out, int attrib_types, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::collect +// Function: SceneGraphReducer::AccumulatedAttribs::collect // Access: Public // Description: Collects the state and transform from the indicated // node and adds it to the accumulator, removing it from // the node. //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer::AccumulatedAttribs:: +void SceneGraphReducer::AccumulatedAttribs:: collect(PandaNode *node, int attrib_types) { if ((attrib_types & TT_transform) != 0) { // Collect the node's transform. @@ -131,7 +131,7 @@ collect(PandaNode *node, int attrib_types) { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::apply_to_node +// Function: SceneGraphReducer::AccumulatedAttribs::apply_to_node // Access: Public // Description: Stores the indicated attributes in the node's // transform and state information; does not attempt to @@ -139,7 +139,7 @@ collect(PandaNode *node, int attrib_types) { // attributes from the accumulator for future // traversals. //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer::AccumulatedAttribs:: +void SceneGraphReducer::AccumulatedAttribs:: apply_to_node(PandaNode *node, int attrib_types) { if ((attrib_types & TT_transform) != 0) { node->set_transform(_transform->compose(node->get_transform())); @@ -192,15 +192,15 @@ apply_to_node(PandaNode *node, int attrib_types) { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::AccumulatedAttribs::apply_to_vertices +// Function: SceneGraphReducer::AccumulatedAttribs::apply_to_vertices // Access: Public // Description: Applies the indicated attributes to the node so that // they do not need to be stored as separate attributes // any more. //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer::AccumulatedAttribs:: +void SceneGraphReducer::AccumulatedAttribs:: apply_to_vertices(PandaNode *node, int attrib_types, - qpGeomTransformer &transformer) { + GeomTransformer &transformer) { if (node->is_geom_node()) { if (pgraph_cat.is_debug()) { pgraph_cat.debug() @@ -210,7 +210,7 @@ apply_to_vertices(PandaNode *node, int attrib_types, // We treat GeomNodes as a special case, since we can apply more // than just a transform matrix and so we can share vertex arrays // across different GeomNodes. - qpGeomNode *gnode = DCAST(qpGeomNode, node); + GeomNode *gnode = DCAST(GeomNode, node); if ((attrib_types & TT_transform) != 0) { if (!_transform->is_identity()) { transformer.transform_vertices(gnode, _transform->get_mat()); @@ -255,25 +255,25 @@ apply_to_vertices(PandaNode *node, int attrib_types, } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::Constructor +// Function: SceneGraphReducer::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpSceneGraphReducer:: -qpSceneGraphReducer() { +SceneGraphReducer:: +SceneGraphReducer() { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::Destructor +// Function: SceneGraphReducer::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpSceneGraphReducer:: -~qpSceneGraphReducer() { +SceneGraphReducer:: +~SceneGraphReducer() { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::apply_attribs +// Function: SceneGraphReducer::apply_attribs // Access: Public // Description: Walks the scene graph, accumulating attribs of // the indicated types, applying them to the vertices, @@ -289,7 +289,7 @@ qpSceneGraphReducer:: // Of course, this operation does make certain dynamic // operations impossible. //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer:: +void SceneGraphReducer:: apply_attribs(PandaNode *node, int attrib_types) { AccumulatedAttribs trans; @@ -303,7 +303,7 @@ apply_attribs(PandaNode *node, int attrib_types) { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::flatten +// Function: SceneGraphReducer::flatten // Access: Public // Description: Simplifies the graph by removing unnecessary nodes // and nodes. @@ -323,7 +323,7 @@ apply_attribs(PandaNode *node, int attrib_types) { // // Returns the number of nodes removed from the graph. //////////////////////////////////////////////////////////////////// -int qpSceneGraphReducer:: +int SceneGraphReducer:: flatten(PandaNode *root, bool combine_siblings) { int num_total_nodes = 0; int num_pass_nodes; @@ -360,13 +360,13 @@ flatten(PandaNode *root, bool combine_siblings) { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::r_apply_attribs +// Function: SceneGraphReducer::r_apply_attribs // Access: Protected // Description: The recursive implementation of apply_attribs(). //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer:: +void SceneGraphReducer:: r_apply_attribs(PandaNode *node, int attrib_types, - qpSceneGraphReducer::AccumulatedAttribs trans) { + SceneGraphReducer::AccumulatedAttribs trans) { if (pgraph_cat.is_debug()) { pgraph_cat.debug() << "r_apply_attribs(" << *node << "), node's attribs are:\n"; @@ -466,11 +466,11 @@ r_apply_attribs(PandaNode *node, int attrib_types, //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::r_flatten +// Function: SceneGraphReducer::r_flatten // Access: Protected // Description: The recursive implementation of flatten(). //////////////////////////////////////////////////////////////////// -int qpSceneGraphReducer:: +int SceneGraphReducer:: r_flatten(PandaNode *grandparent_node, PandaNode *parent_node, bool combine_siblings) { int num_nodes = 0; @@ -543,12 +543,12 @@ operator () (const PandaNode *node1, const PandaNode *node2) const { //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::flatten_siblings +// Function: SceneGraphReducer::flatten_siblings // Access: Protected // Description: Attempts to collapse together any pairs of siblings // of the indicated node that share the same properties. //////////////////////////////////////////////////////////////////// -int qpSceneGraphReducer:: +int SceneGraphReducer:: flatten_siblings(PandaNode *parent_node) { int num_nodes = 0; @@ -616,7 +616,7 @@ flatten_siblings(PandaNode *parent_node) { } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::consider_child +// Function: SceneGraphReducer::consider_child // Access: Protected, Virtual // Description: Decides whether or not the indicated child node is a // suitable candidate for removal. Returns true if the @@ -624,7 +624,7 @@ flatten_siblings(PandaNode *parent_node) { // function may be extended in a user class to protect // special kinds of nodes from deletion. //////////////////////////////////////////////////////////////////// -bool qpSceneGraphReducer:: +bool SceneGraphReducer:: consider_child(PandaNode *grandparent_node, PandaNode *parent_node, PandaNode *child_node) { if (!parent_node->safe_to_combine() || !child_node->safe_to_combine()) { @@ -650,14 +650,14 @@ consider_child(PandaNode *grandparent_node, PandaNode *parent_node, } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer:c:onsider_siblings +// Function: SceneGraphReducer:c:onsider_siblings // Access: Protected, Virtual // Description: Decides whether or not the indicated sibling nodes // should be collapsed into a single node or not. // Returns true if the nodes may be collapsed, false if // they should be kept distinct. //////////////////////////////////////////////////////////////////// -bool qpSceneGraphReducer:: +bool SceneGraphReducer:: consider_siblings(PandaNode *parent_node, PandaNode *child1, PandaNode *child2) { // We don't have to worry about the states being different betweeen @@ -667,7 +667,7 @@ consider_siblings(PandaNode *parent_node, PandaNode *child1, } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::do_flatten_child +// Function: SceneGraphReducer::do_flatten_child // Access: Protected, Virtual // Description: Collapses together the indicated parent node and // child node and leaves the result attached to the @@ -677,7 +677,7 @@ consider_siblings(PandaNode *parent_node, PandaNode *child1, // This function may be extended in a user class to // handle special kinds of nodes. //////////////////////////////////////////////////////////////////// -bool qpSceneGraphReducer:: +bool SceneGraphReducer:: do_flatten_child(PandaNode *grandparent_node, PandaNode *parent_node, PandaNode *child_node) { if (pgraph_cat.is_debug()) { @@ -709,7 +709,7 @@ do_flatten_child(PandaNode *grandparent_node, PandaNode *parent_node, } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::do_flatten_siblings +// Function: SceneGraphReducer::do_flatten_siblings // Access: Protected, Virtual // Description: Performs the work of collapsing two sibling nodes // together into a single node, leaving the resulting @@ -720,7 +720,7 @@ do_flatten_child(PandaNode *grandparent_node, PandaNode *parent_node, // or a new node altogether) if the siblings are // successfully collapsed, or NULL if we chickened out. //////////////////////////////////////////////////////////////////// -PandaNode *qpSceneGraphReducer:: +PandaNode *SceneGraphReducer:: do_flatten_siblings(PandaNode *parent_node, PandaNode *child1, PandaNode *child2) { if (pgraph_cat.is_debug()) { @@ -758,7 +758,7 @@ do_flatten_siblings(PandaNode *parent_node, PandaNode *child1, } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::collapse_nodes +// Function: SceneGraphReducer::collapse_nodes // Access: Protected, Virtual // Description: Collapses the two nodes into a single node, if // possible. The 'siblings' flag is true if the two @@ -771,19 +771,19 @@ do_flatten_siblings(PandaNode *parent_node, PandaNode *child1, // This function may be extended in a user class to // handle combining special kinds of nodes. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpSceneGraphReducer:: +PT(PandaNode) SceneGraphReducer:: collapse_nodes(PandaNode *node1, PandaNode *node2, bool siblings) { return node2->combine_with(node1); } //////////////////////////////////////////////////////////////////// -// Function: qpSceneGraphReducer::choose_name +// Function: SceneGraphReducer::choose_name // Access: Protected, Virtual // Description: Chooses a suitable name for the collapsed node, based // on the names of the two sources nodes. //////////////////////////////////////////////////////////////////// -void qpSceneGraphReducer:: +void SceneGraphReducer:: choose_name(PandaNode *preserve, PandaNode *source1, PandaNode *source2) { string name; bool got_name = false; diff --git a/panda/src/pgraph/qpsceneGraphReducer.h b/panda/src/pgraph/sceneGraphReducer.h similarity index 89% rename from panda/src/pgraph/qpsceneGraphReducer.h rename to panda/src/pgraph/sceneGraphReducer.h index 7111e962e6..489df47448 100644 --- a/panda/src/pgraph/qpsceneGraphReducer.h +++ b/panda/src/pgraph/sceneGraphReducer.h @@ -1,4 +1,4 @@ -// Filename: qpsceneGraphReducer.h +// Filename: sceneGraphReducer.h // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,20 +16,20 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpSCENEGRAPHREDUCER_H -#define qpSCENEGRAPHREDUCER_H +#ifndef SCENEGRAPHREDUCER_H +#define SCENEGRAPHREDUCER_H #include "pandabase.h" #include "transformState.h" #include "renderAttrib.h" #include "renderState.h" -#include "qpgeomTransformer.h" +#include "geomTransformer.h" #include "typedObject.h" #include "pointerTo.h" /////////////////////////////////////////////////////////////////// -// Class : qpSceneGraphReducer +// Class : SceneGraphReducer // Description : An interface for simplifying ("flattening") scene // graphs by eliminating unneeded nodes and collapsing // out unneeded state changes and transforms. @@ -39,10 +39,10 @@ // flattening behavior, but normally the default // behavior is sufficient. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpSceneGraphReducer { +class EXPCL_PANDA SceneGraphReducer { PUBLISHED: - qpSceneGraphReducer(); - virtual ~qpSceneGraphReducer(); + SceneGraphReducer(); + virtual ~SceneGraphReducer(); enum AttribTypes { TT_transform = 0x001, @@ -68,7 +68,7 @@ protected: void collect(PandaNode *node, int attrib_types); void apply_to_node(PandaNode *node, int attrib_types); void apply_to_vertices(PandaNode *node, int attrib_types, - qpGeomTransformer &transfomer); + GeomTransformer &transfomer); CPT(TransformState) _transform; CPT(RenderAttrib) _color; @@ -101,9 +101,9 @@ protected: PandaNode *source2); private: - qpGeomTransformer _transformer; + GeomTransformer _transformer; }; -#include "qpsceneGraphReducer.I" +#include "sceneGraphReducer.I" #endif diff --git a/panda/src/pgraph/sceneSetup.I b/panda/src/pgraph/sceneSetup.I index 686a8f449a..d9c9c23bae 100644 --- a/panda/src/pgraph/sceneSetup.I +++ b/panda/src/pgraph/sceneSetup.I @@ -35,7 +35,7 @@ SceneSetup() { // Description: Specifies the root node of the scene. //////////////////////////////////////////////////////////////////// INLINE void SceneSetup:: -set_scene_root(const qpNodePath &scene_root) { +set_scene_root(const NodePath &scene_root) { _scene_root = scene_root; } @@ -44,7 +44,7 @@ set_scene_root(const qpNodePath &scene_root) { // Access: Public // Description: Returns the root node of the scene. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &SceneSetup:: +INLINE const NodePath &SceneSetup:: get_scene_root() const { return _scene_root; } @@ -55,7 +55,7 @@ get_scene_root() const { // Description: Specifies the NodePath to the camera. //////////////////////////////////////////////////////////////////// INLINE void SceneSetup:: -set_camera_path(const qpNodePath &camera_path) { +set_camera_path(const NodePath &camera_path) { _camera_path = camera_path; } @@ -64,7 +64,7 @@ set_camera_path(const qpNodePath &camera_path) { // Access: Public // Description: Returns the NodePath to the camera. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &SceneSetup:: +INLINE const NodePath &SceneSetup:: get_camera_path() const { return _camera_path; } @@ -75,7 +75,7 @@ get_camera_path() const { // Description: Specifies the camera used to render the scene. //////////////////////////////////////////////////////////////////// INLINE void SceneSetup:: -set_camera_node(const qpCamera *camera_node) { +set_camera_node(const Camera *camera_node) { _camera_node = camera_node; } @@ -84,7 +84,7 @@ set_camera_node(const qpCamera *camera_node) { // Access: Public // Description: Returns the camera used to render the scene. //////////////////////////////////////////////////////////////////// -INLINE const qpCamera *SceneSetup:: +INLINE const Camera *SceneSetup:: get_camera_node() const { return _camera_node; } diff --git a/panda/src/pgraph/sceneSetup.h b/panda/src/pgraph/sceneSetup.h index 105614a616..8896f346f8 100644 --- a/panda/src/pgraph/sceneSetup.h +++ b/panda/src/pgraph/sceneSetup.h @@ -22,8 +22,8 @@ #include "pandabase.h" #include "referenceCount.h" -#include "qpnodePath.h" -#include "qpcamera.h" +#include "nodePath.h" +#include "camera.h" #include "transformState.h" #include "lens.h" #include "pointerTo.h" @@ -38,14 +38,14 @@ class EXPCL_PANDA SceneSetup : public ReferenceCount { public: INLINE SceneSetup(); - INLINE void set_scene_root(const qpNodePath &scene_root); - INLINE const qpNodePath &get_scene_root() const; + INLINE void set_scene_root(const NodePath &scene_root); + INLINE const NodePath &get_scene_root() const; - INLINE void set_camera_path(const qpNodePath &camera_path); - INLINE const qpNodePath &get_camera_path() const; + INLINE void set_camera_path(const NodePath &camera_path); + INLINE const NodePath &get_camera_path() const; - INLINE void set_camera_node(const qpCamera *camera_node); - INLINE const qpCamera *get_camera_node() const; + INLINE void set_camera_node(const Camera *camera_node); + INLINE const Camera *get_camera_node() const; INLINE void set_lens(const Lens *lens); INLINE const Lens *get_lens() const; @@ -60,9 +60,9 @@ public: INLINE const TransformState *get_render_transform() const; private: - qpNodePath _scene_root; - qpNodePath _camera_path; - CPT(qpCamera) _camera_node; + NodePath _scene_root; + NodePath _camera_path; + CPT(Camera) _camera_node; CPT(Lens) _lens; CPT(TransformState) _camera_transform; CPT(TransformState) _world_transform; diff --git a/panda/src/pgraph/qpsequenceNode.I b/panda/src/pgraph/sequenceNode.I similarity index 83% rename from panda/src/pgraph/qpsequenceNode.I rename to panda/src/pgraph/sequenceNode.I index c5b401ce3d..a361610354 100644 --- a/panda/src/pgraph/qpsequenceNode.I +++ b/panda/src/pgraph/sequenceNode.I @@ -1,4 +1,4 @@ -// Filename: qpsequenceNode.I +// Filename: sequenceNode.I // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,11 +18,11 @@ //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::CData::Constructor +// Function: SequenceNode::CData::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpSequenceNode::CData:: +INLINE SequenceNode::CData:: CData() { _cycle_rate = 0.0f; _frame_offset = 0.0f; @@ -30,12 +30,12 @@ CData() { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::CData::Copy Constructor +// Function: SequenceNode::CData::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpSequenceNode::CData:: -CData(const qpSequenceNode::CData ©) : +INLINE SequenceNode::CData:: +CData(const SequenceNode::CData ©) : _cycle_rate(copy._cycle_rate), _frame_offset(copy._frame_offset), _start_time(copy._start_time) @@ -43,12 +43,12 @@ CData(const qpSequenceNode::CData ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::Constructor +// Function: SequenceNode::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpSequenceNode:: -qpSequenceNode(float cycle_rate, const string &name) : +INLINE SequenceNode:: +SequenceNode(float cycle_rate, const string &name) : SelectiveChildNode(name) { CDWriter cdata(_cycler); @@ -60,12 +60,12 @@ qpSequenceNode(float cycle_rate, const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::set_cycle_rate +// Function: SequenceNode::set_cycle_rate // Access: Published // Description: Sets the rate of cycling for the children of the // SequenceNode, in cycles per second. //////////////////////////////////////////////////////////////////// -INLINE void qpSequenceNode:: +INLINE void SequenceNode:: set_cycle_rate(float cycle_rate) { // Do some fussing so we keep the same frame visible while we // change this. @@ -77,24 +77,24 @@ set_cycle_rate(float cycle_rate) { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::get_cycle_rate +// Function: SequenceNode::get_cycle_rate // Access: Published // Description: Returns the rate of cycling for the children of the // SequenceNode, in cycles per second. //////////////////////////////////////////////////////////////////// -INLINE float qpSequenceNode:: +INLINE float SequenceNode:: get_cycle_rate() const { CDReader cdata(_cycler); return cdata->_cycle_rate; } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::get_visible_child +// Function: SequenceNode::get_visible_child // Access: Published // Description: Returns the index of the child that should be visible // for this particular frame, if there are any children. //////////////////////////////////////////////////////////////////// -INLINE int qpSequenceNode:: +INLINE int SequenceNode:: get_visible_child() const { int num_children = get_num_children(); if (num_children == 0) { @@ -107,24 +107,24 @@ get_visible_child() const { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::calc_frame +// Function: SequenceNode::calc_frame // Access: Private // Description: Returns the floating-point frame number at the // indicated time. //////////////////////////////////////////////////////////////////// -INLINE float qpSequenceNode:: +INLINE float SequenceNode:: calc_frame(float now) const { CDReader cdata(_cycler); return (now - cdata->_start_time) * cdata->_cycle_rate + cdata->_frame_offset; } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::calc_frame +// Function: SequenceNode::calc_frame // Access: Private // Description: Returns the floating-point frame number at the // current time. //////////////////////////////////////////////////////////////////// -INLINE float qpSequenceNode:: +INLINE float SequenceNode:: calc_frame() const { return calc_frame(ClockObject::get_global_clock()->get_frame_time()); } diff --git a/panda/src/pgraph/qpsequenceNode.cxx b/panda/src/pgraph/sequenceNode.cxx similarity index 81% rename from panda/src/pgraph/qpsequenceNode.cxx rename to panda/src/pgraph/sequenceNode.cxx index 0dd6416392..f4b4e296df 100644 --- a/panda/src/pgraph/qpsequenceNode.cxx +++ b/panda/src/pgraph/sequenceNode.cxx @@ -1,4 +1,4 @@ -// Filename: qpsequenceNode.cxx +// Filename: sequenceNode.cxx // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -17,23 +17,23 @@ //////////////////////////////////////////////////////////////////// #include "pandabase.h" -#include "qpsequenceNode.h" -#include "qpcullTraverser.h" +#include "sequenceNode.h" +#include "cullTraverser.h" -TypeHandle qpSequenceNode::_type_handle; +TypeHandle SequenceNode::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::CData::make_copy +// Function: SequenceNode::CData::make_copy // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -CycleData *qpSequenceNode::CData:: +CycleData *SequenceNode::CData:: make_copy() const { return new CData(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::safe_to_combine +// Function: SequenceNode::safe_to_combine // Access: Public, Virtual // Description: Returns true if it is generally safe to combine this // particular kind of PandaNode with other kinds of @@ -42,18 +42,18 @@ make_copy() const { // other PandaNode, because its set of children is // meaningful. //////////////////////////////////////////////////////////////////// -bool qpSequenceNode:: +bool SequenceNode:: safe_to_combine() const { return false; } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::CData::write_datagram +// Function: SequenceNode::CData::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpSequenceNode::CData:: +void SequenceNode::CData:: write_datagram(BamWriter *manager, Datagram &dg) const { dg.add_float32(_cycle_rate); @@ -63,13 +63,13 @@ write_datagram(BamWriter *manager, Datagram &dg) const { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::CData::fillin +// Function: SequenceNode::CData::fillin // Access: Public, Virtual // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpSequenceNode. +// the new SequenceNode. //////////////////////////////////////////////////////////////////// -void qpSequenceNode::CData:: +void SequenceNode::CData:: fillin(DatagramIterator &scan, BamReader *manager) { _cycle_rate = scan.get_float32(); _frame_offset = scan.get_float32(); @@ -79,32 +79,32 @@ fillin(DatagramIterator &scan, BamReader *manager) { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::Copy Constructor +// Function: SequenceNode::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpSequenceNode:: -qpSequenceNode(const qpSequenceNode ©) : +SequenceNode:: +SequenceNode(const SequenceNode ©) : SelectiveChildNode(copy), _cycler(copy._cycler) { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::make_copy +// Function: SequenceNode::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpSequenceNode:: +PandaNode *SequenceNode:: make_copy() const { - return new qpSequenceNode(*this); + return new SequenceNode(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::has_cull_callback +// Function: SequenceNode::has_cull_callback // Access: Public, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -112,13 +112,13 @@ make_copy() const { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpSequenceNode:: +bool SequenceNode:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::cull_callback +// Function: SequenceNode::cull_callback // Access: Public, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -136,46 +136,46 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpSequenceNode:: -cull_callback(qpCullTraverser *, CullTraverserData &) { +bool SequenceNode:: +cull_callback(CullTraverser *, CullTraverserData &) { select_child(get_visible_child()); return true; } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::register_with_read_factory +// Function: SequenceNode::register_with_read_factory // Access: Public, Static // Description: Tells the BamReader how to create objects of type -// qpSequenceNode. +// SequenceNode. //////////////////////////////////////////////////////////////////// -void qpSequenceNode:: +void SequenceNode:: register_with_read_factory() { BamReader::get_factory()->register_factory(get_class_type(), make_from_bam); } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::write_datagram +// Function: SequenceNode::write_datagram // Access: Public, Virtual // Description: Writes the contents of this object to the datagram // for shipping out to a Bam file. //////////////////////////////////////////////////////////////////// -void qpSequenceNode:: +void SequenceNode:: write_datagram(BamWriter *manager, Datagram &dg) { SelectiveChildNode::write_datagram(manager, dg); manager->write_cdata(dg, _cycler); } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::make_from_bam +// Function: SequenceNode::make_from_bam // Access: Protected, Static // Description: This function is called by the BamReader's factory -// when a new object of type qpSequenceNode is encountered -// in the Bam file. It should create the qpSequenceNode +// when a new object of type SequenceNode is encountered +// in the Bam file. It should create the SequenceNode // and extract its information from the file. //////////////////////////////////////////////////////////////////// -TypedWritable *qpSequenceNode:: +TypedWritable *SequenceNode:: make_from_bam(const FactoryParams ¶ms) { - qpSequenceNode *node = new qpSequenceNode(0.0f, ""); + SequenceNode *node = new SequenceNode(0.0f, ""); DatagramIterator scan; BamReader *manager; @@ -186,13 +186,13 @@ make_from_bam(const FactoryParams ¶ms) { } //////////////////////////////////////////////////////////////////// -// Function: qpSequenceNode::fillin +// Function: SequenceNode::fillin // Access: Protected // Description: This internal function is called by make_from_bam to // read in all of the relevant data from the BamFile for -// the new qpSequenceNode. +// the new SequenceNode. //////////////////////////////////////////////////////////////////// -void qpSequenceNode:: +void SequenceNode:: fillin(DatagramIterator &scan, BamReader *manager) { SelectiveChildNode::fillin(scan, manager); manager->read_cdata(scan, _cycler); diff --git a/panda/src/pgraph/qpsequenceNode.h b/panda/src/pgraph/sequenceNode.h similarity index 86% rename from panda/src/pgraph/qpsequenceNode.h rename to panda/src/pgraph/sequenceNode.h index b4730c4836..e81baa9b41 100644 --- a/panda/src/pgraph/qpsequenceNode.h +++ b/panda/src/pgraph/sequenceNode.h @@ -1,4 +1,4 @@ -// Filename: qpsequenceNode.h +// Filename: sequenceNode.h // Created by: drose (06Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpSEQUENCENODE_H -#define qpSEQUENCENODE_H +#ifndef SEQUENCENODE_H +#define SEQUENCENODE_H #include "pandabase.h" @@ -29,18 +29,18 @@ // Description : A node that automatically cycles through rendering // each one of its children according to its frame rate. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpSequenceNode : public SelectiveChildNode { +class EXPCL_PANDA SequenceNode : public SelectiveChildNode { PUBLISHED: - INLINE qpSequenceNode(float cycle_rate, const string &name); + INLINE SequenceNode(float cycle_rate, const string &name); public: - qpSequenceNode(const qpSequenceNode ©); + SequenceNode(const SequenceNode ©); virtual PandaNode *make_copy() const; virtual bool safe_to_combine() const; virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); PUBLISHED: INLINE void set_cycle_rate(float cycle_rate); @@ -83,7 +83,7 @@ public: } static void init_type() { SelectiveChildNode::init_type(); - register_type(_type_handle, "qpSequenceNode", + register_type(_type_handle, "SequenceNode", SelectiveChildNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -95,6 +95,6 @@ private: static TypeHandle _type_handle; }; -#include "qpsequenceNode.I" +#include "sequenceNode.I" #endif diff --git a/panda/src/pgraph/spotlight.cxx b/panda/src/pgraph/spotlight.cxx index 0850565607..033f912235 100644 --- a/panda/src/pgraph/spotlight.cxx +++ b/panda/src/pgraph/spotlight.cxx @@ -239,7 +239,7 @@ make_image(Texture *texture, float radius) { // for rendering this light. //////////////////////////////////////////////////////////////////// void Spotlight:: -fill_viz_geom(qpGeomNode *viz_geom) { +fill_viz_geom(GeomNode *viz_geom) { Lens *lens = get_lens(); if (lens == (Lens *)NULL) { return; diff --git a/panda/src/pgraph/spotlight.h b/panda/src/pgraph/spotlight.h index a5e4f9d082..ac5b17827f 100644 --- a/panda/src/pgraph/spotlight.h +++ b/panda/src/pgraph/spotlight.h @@ -65,7 +65,7 @@ public: bool make_image(Texture *texture, float radius); protected: - virtual void fill_viz_geom(qpGeomNode *viz_geom); + virtual void fill_viz_geom(GeomNode *viz_geom); private: CPT(RenderState) get_viz_state(); diff --git a/panda/src/pgraph/test_pgraph.cxx b/panda/src/pgraph/test_pgraph.cxx index 3564d3a22d..926e64b04b 100644 --- a/panda/src/pgraph/test_pgraph.cxx +++ b/panda/src/pgraph/test_pgraph.cxx @@ -17,22 +17,22 @@ //////////////////////////////////////////////////////////////////// #include "pandaNode.h" -#include "qpnodePath.h" +#include "nodePath.h" int main(int argc, char *argv[]) { - qpNodePath h("h"); - qpNodePath n1("n1"); - qpNodePath n2("n2"); + NodePath h("h"); + NodePath n1("n1"); + NodePath n2("n2"); PT(PandaNode) node = new PandaNode("node"); - qpNodePath t1 = h.attach_new_node(node); + NodePath t1 = h.attach_new_node(node); t1.reparent_to(n1); - t1 = qpNodePath(); + t1 = NodePath(); - qpNodePath t2 = h.attach_new_node(node); + NodePath t2 = h.attach_new_node(node); t2.reparent_to(n2); return 0; } diff --git a/panda/src/pgraph/textureCollection.cxx b/panda/src/pgraph/textureCollection.cxx index 648f4e048b..58681a2918 100644 --- a/panda/src/pgraph/textureCollection.cxx +++ b/panda/src/pgraph/textureCollection.cxx @@ -110,7 +110,7 @@ remove_texture(Texture *node_texture) { //////////////////////////////////////////////////////////////////// // Function: TextureCollection::add_textures_from // Access: Published -// Description: Adds all the qpTextures indicated in the other +// Description: Adds all the Textures indicated in the other // collection to this texture. The other textures are simply // appended to the end of the textures in this list; // duplicates are not automatically removed. @@ -127,7 +127,7 @@ add_textures_from(const TextureCollection &other) { //////////////////////////////////////////////////////////////////// // Function: TextureCollection::remove_textures_from // Access: Published -// Description: Removes from this collection all of the qpTextures +// Description: Removes from this collection all of the Textures // listed in the other collection. //////////////////////////////////////////////////////////////////// void TextureCollection:: diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index d835b6af43..5b05db3763 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -28,6 +28,7 @@ #include "pset.h" class GraphicsStateGuardianBase; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : TransformState diff --git a/panda/src/pgraph/workingNodePath.I b/panda/src/pgraph/workingNodePath.I index b6cb71fd69..c19df9298f 100644 --- a/panda/src/pgraph/workingNodePath.I +++ b/panda/src/pgraph/workingNodePath.I @@ -26,7 +26,7 @@ // NodePath. //////////////////////////////////////////////////////////////////// INLINE WorkingNodePath:: -WorkingNodePath(const qpNodePath &start) { +WorkingNodePath(const NodePath &start) { nassertv(!start.is_empty()); _next = (WorkingNodePath *)NULL; _start = start._head; @@ -44,7 +44,7 @@ WorkingNodePath(const qpNodePath &start) { INLINE WorkingNodePath:: WorkingNodePath(const WorkingNodePath &parent, PandaNode *child) { _next = &parent; - _start = (qpNodePathComponent *)NULL; + _start = (NodePathComponent *)NULL; _node = child; } @@ -63,11 +63,11 @@ INLINE WorkingNodePath:: // Description: Constructs and returns an actual NodePath that // represents the same path we have just traversed. //////////////////////////////////////////////////////////////////// -INLINE qpNodePath WorkingNodePath:: +INLINE NodePath WorkingNodePath:: get_node_path() const { - qpNodePath result; + NodePath result; result._head = r_get_node_path(); - nassertr(result._head != (qpNodePathComponent *)NULL, qpNodePath::fail()); + nassertr(result._head != (NodePathComponent *)NULL, NodePath::fail()); return result; } diff --git a/panda/src/pgraph/workingNodePath.cxx b/panda/src/pgraph/workingNodePath.cxx index c337aa46eb..a61e3abf7f 100644 --- a/panda/src/pgraph/workingNodePath.cxx +++ b/panda/src/pgraph/workingNodePath.cxx @@ -41,16 +41,16 @@ get_num_nodes() const { // get_node_path(), this returns the NodePathComponent // representing the NodePath. //////////////////////////////////////////////////////////////////// -PT(qpNodePathComponent) WorkingNodePath:: +PT(NodePathComponent) WorkingNodePath:: r_get_node_path() const { if (_next == (WorkingNodePath *)NULL) { return _start; } - nassertr(_start == (qpNodePathComponent *)NULL, NULL); + nassertr(_start == (NodePathComponent *)NULL, NULL); nassertr(_node != (PandaNode *)NULL, NULL); - PT(qpNodePathComponent) comp = _next->r_get_node_path(); - nassertr(comp != (qpNodePathComponent *)NULL, NULL); + PT(NodePathComponent) comp = _next->r_get_node_path(); + nassertr(comp != (NodePathComponent *)NULL, NULL); return PandaNode::get_component(comp, _node); } diff --git a/panda/src/pgraph/workingNodePath.h b/panda/src/pgraph/workingNodePath.h index 3f81aa8bbf..574af02e1a 100644 --- a/panda/src/pgraph/workingNodePath.h +++ b/panda/src/pgraph/workingNodePath.h @@ -21,8 +21,8 @@ #include "pandabase.h" -#include "qpnodePath.h" -#include "qpnodePathComponent.h" +#include "nodePath.h" +#include "nodePathComponent.h" //////////////////////////////////////////////////////////////////// // Class : WorkingNodePath @@ -48,23 +48,23 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA WorkingNodePath { public: - INLINE WorkingNodePath(const qpNodePath &start); + INLINE WorkingNodePath(const NodePath &start); INLINE WorkingNodePath(const WorkingNodePath &parent, PandaNode *child); INLINE ~WorkingNodePath(); - INLINE qpNodePath get_node_path() const; + INLINE NodePath get_node_path() const; INLINE PandaNode *node() const; int get_num_nodes() const; private: - PT(qpNodePathComponent) r_get_node_path() const; + PT(NodePathComponent) r_get_node_path() const; // Either one or the other of these pointers will be filled in, but // never both. We maintain a linked list of WorkingNodePath // objects, with a NodePathComponent at the head of the list. const WorkingNodePath *_next; - PT(qpNodePathComponent) _start; + PT(NodePathComponent) _start; PandaNode *_node; }; diff --git a/panda/src/pgui/Sources.pp b/panda/src/pgui/Sources.pp index 55069aebe0..455f51deea 100644 --- a/panda/src/pgui/Sources.pp +++ b/panda/src/pgui/Sources.pp @@ -11,44 +11,44 @@ #define SOURCES \ config_pgui.h \ - qppgButton.I qppgButton.h \ + pgButton.I pgButton.h \ pgCullTraverser.I pgCullTraverser.h \ - qppgEntry.I qppgEntry.h \ + pgEntry.I pgEntry.h \ pgMouseWatcherGroup.I pgMouseWatcherGroup.h \ pgMouseWatcherParameter.I pgMouseWatcherParameter.h \ pgFrameStyle.I pgFrameStyle.h \ - qppgItem.I qppgItem.h \ + pgItem.I pgItem.h \ pgMouseWatcherBackground.h \ pgMouseWatcherRegion.I pgMouseWatcherRegion.h \ - qppgTop.I qppgTop.h \ - qppgWaitBar.I qppgWaitBar.h + pgTop.I pgTop.h \ + pgWaitBar.I pgWaitBar.h #define INCLUDED_SOURCES \ config_pgui.cxx \ - qppgButton.cxx \ + pgButton.cxx \ pgCullTraverser.cxx \ - qppgEntry.cxx \ + pgEntry.cxx \ pgMouseWatcherGroup.cxx \ pgMouseWatcherParameter.cxx \ pgFrameStyle.cxx \ - qppgItem.cxx \ + pgItem.cxx \ pgMouseWatcherBackground.cxx \ pgMouseWatcherRegion.cxx \ - qppgTop.cxx \ - qppgWaitBar.cxx + pgTop.cxx \ + pgWaitBar.cxx #define INSTALL_HEADERS \ - qppgButton.I qppgButton.h \ + pgButton.I pgButton.h \ pgCullTraverser.I pgCullTraverser.h \ - qppgEntry.I qppgEntry.h \ + pgEntry.I pgEntry.h \ pgMouseWatcherGroup.I pgMouseWatcherGroup.h \ pgMouseWatcherParameter.I pgMouseWatcherParameter.h \ pgFrameStyle.I pgFrameStyle.h \ - qppgItem.I qppgItem.h \ + pgItem.I pgItem.h \ pgMouseWatcherBackground.h \ pgMouseWatcherRegion.I pgMouseWatcherRegion.h \ - qppgTop.I qppgTop.h \ - qppgWaitBar.I qppgWaitBar.h + pgTop.I pgTop.h \ + pgWaitBar.I pgWaitBar.h #define IGATESCAN all diff --git a/panda/src/pgui/config_pgui.cxx b/panda/src/pgui/config_pgui.cxx index 1122860a9c..4255a8fdb1 100644 --- a/panda/src/pgui/config_pgui.cxx +++ b/panda/src/pgui/config_pgui.cxx @@ -17,16 +17,16 @@ //////////////////////////////////////////////////////////////////// #include "config_pgui.h" -#include "qppgButton.h" +#include "pgButton.h" #include "pgCullTraverser.h" -#include "qppgEntry.h" +#include "pgEntry.h" #include "pgMouseWatcherParameter.h" #include "pgMouseWatcherGroup.h" -#include "qppgItem.h" +#include "pgItem.h" #include "pgMouseWatcherBackground.h" #include "pgMouseWatcherRegion.h" -#include "qppgTop.h" -#include "qppgWaitBar.h" +#include "pgTop.h" +#include "pgWaitBar.h" #include "dconfig.h" @@ -63,14 +63,14 @@ init_libpgui() { } initialized = true; - qpPGButton::init_type(); + PGButton::init_type(); PGCullTraverser::init_type(); - qpPGEntry::init_type(); + PGEntry::init_type(); PGMouseWatcherParameter::init_type(); PGMouseWatcherGroup::init_type(); - qpPGItem::init_type(); + PGItem::init_type(); PGMouseWatcherBackground::init_type(); PGMouseWatcherRegion::init_type(); - qpPGTop::init_type(); - qpPGWaitBar::init_type(); + PGTop::init_type(); + PGWaitBar::init_type(); } diff --git a/panda/src/pgui/qppgButton.I b/panda/src/pgui/pgButton.I similarity index 79% rename from panda/src/pgui/qppgButton.I rename to panda/src/pgui/pgButton.I index 25eca20578..07906136cb 100644 --- a/panda/src/pgui/qppgButton.I +++ b/panda/src/pgui/pgButton.I @@ -1,4 +1,4 @@ -// Filename: qppgButton.I +// Filename: pgButton.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,58 +18,58 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::setup +// Function: PGButton::setup // Access: Published // Description: Sets up the button using the indicated NodePath as // arbitrary geometry. //////////////////////////////////////////////////////////////////// -INLINE void qpPGButton:: -setup(const qpNodePath &ready) { +INLINE void PGButton:: +setup(const NodePath &ready) { setup(ready, ready, ready, ready); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::setup +// Function: PGButton::setup // Access: Published // Description: Sets up the button using the indicated NodePath as // arbitrary geometry. //////////////////////////////////////////////////////////////////// -INLINE void qpPGButton:: -setup(const qpNodePath &ready, const qpNodePath &depressed) { +INLINE void PGButton:: +setup(const NodePath &ready, const NodePath &depressed) { setup(ready, depressed, ready, ready); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::setup +// Function: PGButton::setup // Access: Published // Description: Sets up the button using the indicated NodePath as // arbitrary geometry. //////////////////////////////////////////////////////////////////// -INLINE void qpPGButton:: -setup(const qpNodePath &ready, const qpNodePath &depressed, - const qpNodePath &rollover) { +INLINE void PGButton:: +setup(const NodePath &ready, const NodePath &depressed, + const NodePath &rollover) { setup(ready, depressed, rollover, ready); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::get_click_prefix +// Function: PGButton::get_click_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the click -// event for all qpPGButtons. The click event is the +// event for all PGButtons. The click event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGButton:: +INLINE string PGButton:: get_click_prefix() { return "click-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::get_click_event +// Function: PGButton::get_click_event // Access: Published // Description: Returns the event name that will be thrown when the // button is clicked normally. //////////////////////////////////////////////////////////////////// -INLINE string qpPGButton:: +INLINE string PGButton:: get_click_event(const ButtonHandle &button) const { return "click-" + button.get_name() + "-" + get_id(); } diff --git a/panda/src/pgui/qppgButton.cxx b/panda/src/pgui/pgButton.cxx similarity index 83% rename from panda/src/pgui/qppgButton.cxx rename to panda/src/pgui/pgButton.cxx index 0b981d8ca5..1981fb4ad9 100644 --- a/panda/src/pgui/qppgButton.cxx +++ b/panda/src/pgui/pgButton.cxx @@ -1,4 +1,4 @@ -// Filename: qppgButton.cxx +// Filename: pgButton.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qppgButton.h" +#include "pgButton.h" #include "pgMouseWatcherParameter.h" #include "throw_event.h" @@ -25,15 +25,15 @@ #include "colorAttrib.h" #include "transformState.h" -TypeHandle qpPGButton::_type_handle; +TypeHandle PGButton::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::Constructor +// Function: PGButton::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpPGButton:: -qpPGButton(const string &name) : qpPGItem(name) +PGButton:: +PGButton(const string &name) : PGItem(name) { _button_down = false; _click_buttons.insert(MouseButton::one()); @@ -42,75 +42,75 @@ qpPGButton(const string &name) : qpPGItem(name) } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::Destructor +// Function: PGButton::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpPGButton:: -~qpPGButton() { +PGButton:: +~PGButton() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::Copy Constructor +// Function: PGButton::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpPGButton:: -qpPGButton(const qpPGButton ©) : - qpPGItem(copy) +PGButton:: +PGButton(const PGButton ©) : + PGItem(copy) { _button_down = false; } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::make_copy +// Function: PGButton::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpPGButton:: +PandaNode *PGButton:: make_copy() const { - return new qpPGButton(*this); + return new PGButton(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::enter +// Function: PGButton::enter // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse enters the region. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: enter(const MouseWatcherParameter ¶m) { if (get_active()) { set_state(_button_down ? S_depressed : S_rollover); } - qpPGItem::enter(param); + PGItem::enter(param); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::exit +// Function: PGButton::exit // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse exits the region. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: exit(const MouseWatcherParameter ¶m) { if (get_active()) { set_state(S_ready); } - qpPGItem::exit(param); + PGItem::exit(param); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::press +// Function: PGButton::press // Access: Public, Virtual // Description: This is a callback hook function, called whenever a // mouse or keyboard button is depressed while the mouse // is within the region. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: press(const MouseWatcherParameter ¶m, bool background) { if (has_click_button(param.get_button())) { if (get_active()) { @@ -118,17 +118,17 @@ press(const MouseWatcherParameter ¶m, bool background) { set_state(S_depressed); } } - qpPGItem::press(param, background); + PGItem::press(param, background); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::release +// Function: PGButton::release // Access: Public, Virtual // Description: This is a callback hook function, called whenever a // mouse or keyboard button previously depressed with // press() is released. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: release(const MouseWatcherParameter ¶m, bool background) { if (has_click_button(param.get_button())) { _button_down = false; @@ -141,16 +141,16 @@ release(const MouseWatcherParameter ¶m, bool background) { } } } - qpPGItem::release(param, background); + PGItem::release(param, background); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::click +// Function: PGButton::click // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // button is clicked down-and-up by the user normally. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: click(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_click_event(param.get_button()); @@ -159,7 +159,7 @@ click(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::setup +// Function: PGButton::setup // Access: Published // Description: Sets up the button as a default text button using the // indicated label string. The TextNode defined by @@ -167,14 +167,14 @@ click(const MouseWatcherParameter ¶m) { // label geometry. This automatically sets up the frame // according to the size of the text. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: setup(const string &label) { clear_state_def(S_ready); clear_state_def(S_depressed); clear_state_def(S_rollover); clear_state_def(S_inactive); - qpTextNode *text_node = get_text_node(); + TextNode *text_node = get_text_node(); text_node->set_text(label); PT(PandaNode) geom = text_node->generate(); @@ -217,14 +217,14 @@ setup(const string &label) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::setup +// Function: PGButton::setup // Access: Published // Description: Sets up the button using the indicated NodePath as // arbitrary geometry. //////////////////////////////////////////////////////////////////// -void qpPGButton:: -setup(const qpNodePath &ready, const qpNodePath &depressed, - const qpNodePath &rollover, const qpNodePath &inactive) { +void PGButton:: +setup(const NodePath &ready, const NodePath &depressed, + const NodePath &rollover, const NodePath &inactive) { clear_state_def(S_ready); clear_state_def(S_depressed); clear_state_def(S_rollover); @@ -237,55 +237,55 @@ setup(const qpNodePath &ready, const qpNodePath &depressed, } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::set_active +// Function: PGButton::set_active // Access: Published, Virtual // Description: Toggles the active/inactive state of the button. In -// the case of a qpPGButton, this also changes its visual +// the case of a PGButton, this also changes its visual // appearance. //////////////////////////////////////////////////////////////////// -void qpPGButton:: +void PGButton:: set_active(bool active) { if (active != get_active()) { - qpPGItem::set_active(active); + PGItem::set_active(active); set_state(active ? S_ready : S_inactive); } } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::add_click_button +// Function: PGButton::add_click_button // Access: Published // Description: Adds the indicated button to the set of buttons that -// can effectively "click" the qpPGButton. Normally, this +// can effectively "click" the PGButton. Normally, this // is just MouseButton::one(). Returns true if the // button was added, or false if it was already there. //////////////////////////////////////////////////////////////////// -bool qpPGButton:: +bool PGButton:: add_click_button(const ButtonHandle &button) { return _click_buttons.insert(button).second; } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::remove_click_button +// Function: PGButton::remove_click_button // Access: Published // Description: Removes the indicated button from the set of buttons -// that can effectively "click" the qpPGButton. Normally, +// that can effectively "click" the PGButton. Normally, // this is just MouseButton::one(). Returns true if the // button was removed, or false if it was not in the // set. //////////////////////////////////////////////////////////////////// -bool qpPGButton:: +bool PGButton:: remove_click_button(const ButtonHandle &button) { return (_click_buttons.erase(button) != 0); } //////////////////////////////////////////////////////////////////// -// Function: qpPGButton::has_click_button +// Function: PGButton::has_click_button // Access: Published // Description: Returns true if the indicated button is on the set of -// buttons that can effectively "click" the qpPGButton. +// buttons that can effectively "click" the PGButton. // Normally, this is just MouseButton::one(). //////////////////////////////////////////////////////////////////// -bool qpPGButton:: +bool PGButton:: has_click_button(const ButtonHandle &button) { return (_click_buttons.count(button) != 0); } diff --git a/panda/src/pgui/qppgButton.h b/panda/src/pgui/pgButton.h similarity index 73% rename from panda/src/pgui/qppgButton.h rename to panda/src/pgui/pgButton.h index d800ef8c35..50e699e0bb 100644 --- a/panda/src/pgui/qppgButton.h +++ b/panda/src/pgui/pgButton.h @@ -1,4 +1,4 @@ -// Filename: qppgButton.h +// Filename: pgButton.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,29 +16,29 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPGBUTTON_H -#define qpPGBUTTON_H +#ifndef PGBUTTON_H +#define PGBUTTON_H #include "pandabase.h" -#include "qppgItem.h" -#include "qpnodePath.h" +#include "pgItem.h" +#include "nodePath.h" #include "pset.h" //////////////////////////////////////////////////////////////////// -// Class : qpPGButton +// Class : PGButton // Description : This is a particular kind of PGItem that is // specialized to behave like a normal button object. // It keeps track of its own state, and handles mouse // events sensibly. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPGButton : public qpPGItem { +class EXPCL_PANDA PGButton : public PGItem { PUBLISHED: - qpPGButton(const string &name); - virtual ~qpPGButton(); + PGButton(const string &name); + virtual ~PGButton(); protected: - qpPGButton(const qpPGButton ©); + PGButton(const PGButton ©); public: virtual PandaNode *make_copy() const; @@ -59,12 +59,12 @@ PUBLISHED: }; void setup(const string &label); - INLINE void setup(const qpNodePath &ready); - INLINE void setup(const qpNodePath &ready, const qpNodePath &depressed); - INLINE void setup(const qpNodePath &ready, const qpNodePath &depressed, - const qpNodePath &rollover); - void setup(const qpNodePath &ready, const qpNodePath &depressed, - const qpNodePath &rollover, const qpNodePath &inactive); + INLINE void setup(const NodePath &ready); + INLINE void setup(const NodePath &ready, const NodePath &depressed); + INLINE void setup(const NodePath &ready, const NodePath &depressed, + const NodePath &rollover); + void setup(const NodePath &ready, const NodePath &depressed, + const NodePath &rollover, const NodePath &inactive); virtual void set_active(bool active); @@ -86,9 +86,9 @@ public: return _type_handle; } static void init_type() { - qpPGItem::init_type(); - register_type(_type_handle, "qpPGButton", - qpPGItem::get_class_type()); + PGItem::init_type(); + register_type(_type_handle, "PGButton", + PGItem::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -99,6 +99,6 @@ private: static TypeHandle _type_handle; }; -#include "qppgButton.I" +#include "pgButton.I" #endif diff --git a/panda/src/pgui/pgCullTraverser.I b/panda/src/pgui/pgCullTraverser.I index 0db24ff008..0e23c07bed 100644 --- a/panda/src/pgui/pgCullTraverser.I +++ b/panda/src/pgui/pgCullTraverser.I @@ -23,8 +23,8 @@ // Description: //////////////////////////////////////////////////////////////////// PGCullTraverser:: -PGCullTraverser(qpPGTop *top, qpCullTraverser *trav) : - qpCullTraverser(*trav), +PGCullTraverser(PGTop *top, CullTraverser *trav) : + CullTraverser(*trav), _top(top) { _sort_index = 0; diff --git a/panda/src/pgui/pgCullTraverser.h b/panda/src/pgui/pgCullTraverser.h index 9c88ed2cf1..400b059f00 100644 --- a/panda/src/pgui/pgCullTraverser.h +++ b/panda/src/pgui/pgCullTraverser.h @@ -21,8 +21,8 @@ #include "pandabase.h" -#include "qppgTop.h" -#include "qpcullTraverser.h" +#include "pgTop.h" +#include "cullTraverser.h" //////////////////////////////////////////////////////////////////// // Class : PGCullTraverser @@ -33,11 +33,11 @@ // that PGItems can know how to register their regions // with the current MouseWatcherGroup. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA PGCullTraverser : public qpCullTraverser { +class EXPCL_PANDA PGCullTraverser : public CullTraverser { public: - INLINE PGCullTraverser(qpPGTop *top, qpCullTraverser *trav); + INLINE PGCullTraverser(PGTop *top, CullTraverser *trav); - qpPGTop *_top; + PGTop *_top; int _sort_index; public: @@ -45,9 +45,9 @@ public: return _type_handle; } static void init_type() { - qpCullTraverser::init_type(); + CullTraverser::init_type(); register_type(_type_handle, "PGCullTraverser", - qpCullTraverser::get_class_type()); + CullTraverser::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/pgui/qppgEntry.I b/panda/src/pgui/pgEntry.I similarity index 84% rename from panda/src/pgui/qppgEntry.I rename to panda/src/pgui/pgEntry.I index 67ddfabf15..1d1c36c47a 100644 --- a/panda/src/pgui/qppgEntry.I +++ b/panda/src/pgui/pgEntry.I @@ -1,4 +1,4 @@ -// Filename: qppgEntry.I +// Filename: pgEntry.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,44 +18,44 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_text +// Function: PGEntry::set_text // Access: Published // Description: Changes the text currently displayed within the // entry. This uses the Unicode encoding currently // specified for the "focus" TextNode; therefore, the // TextNode must exist before calling set_text(). //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_text(const string &text) { - qpTextNode *text_node = get_text_def(S_focus); - nassertv(text_node != (qpTextNode *)NULL); + TextNode *text_node = get_text_def(S_focus); + nassertv(text_node != (TextNode *)NULL); set_wtext(text_node->decode_text(text)); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_text +// Function: PGEntry::get_text // Access: Published // Description: Returns the text currently displayed within the // entry. This uses the Unicode encoding currently // specified for the "focus" TextNode; therefore, the // TextNode must exist before calling get_text(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_text() const { - qpTextNode *text_node = get_text_def(S_focus); - nassertr(text_node != (qpTextNode *)NULL, string()); + TextNode *text_node = get_text_def(S_focus); + nassertr(text_node != (TextNode *)NULL, string()); return text_node->encode_wtext(get_wtext()); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_cursor_position +// Function: PGEntry::set_cursor_position // Access: Published // Description: Sets the current position of the cursor. This is the // position within the text at which the next letter // typed by the user will be inserted; normally it is // the same as the length of the text. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_cursor_position(int position) { if (_cursor_position != position) { _cursor_position = position; @@ -65,17 +65,17 @@ set_cursor_position(int position) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_cursor_position +// Function: PGEntry::get_cursor_position // Access: Published // Description: Returns the current position of the cursor. //////////////////////////////////////////////////////////////////// -INLINE int qpPGEntry:: +INLINE int PGEntry:: get_cursor_position() const { return _cursor_position; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_max_chars +// Function: PGEntry::set_max_chars // Access: Published // Description: Sets the maximum number of characters that may be // typed into the entry. This is a limit on the number @@ -84,25 +84,25 @@ get_cursor_position() const { // // If this is 0, there is no limit. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_max_chars(int max_chars) { _max_chars = max_chars; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_max_chars +// Function: PGEntry::get_max_chars // Access: Published // Description: Returns the current maximum number of characters that // may be typed into the entry, or 0 if there is no // limit. See set_max_chars(). //////////////////////////////////////////////////////////////////// -INLINE int qpPGEntry:: +INLINE int PGEntry:: get_max_chars() const { return _max_chars; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_max_width +// Function: PGEntry::set_max_width // Access: Published // Description: Sets the maximum width of all characters that may be // typed into the entry. This is a limit on the width @@ -116,32 +116,32 @@ get_max_chars() const { // the wordwrap width (and the width limit on the entry // is essentially _max_width * _num_lines). //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_max_width(float max_width) { _max_width = max_width; _text_geom_stale = true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_max_width +// Function: PGEntry::get_max_width // Access: Published // Description: Returns the current maximum width of the characters // that may be typed into the entry, or 0 if there is no // limit. See set_max_width(). //////////////////////////////////////////////////////////////////// -INLINE float qpPGEntry:: +INLINE float PGEntry:: get_max_width() const { return _max_width; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_num_lines +// Function: PGEntry::set_num_lines // Access: Published -// Description: Sets the number of lines of text the qpPGEntry will +// Description: Sets the number of lines of text the PGEntry will // use. This only has meaning if _max_width is not 0; // _max_width indicates the wordwrap width of each line. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_num_lines(int num_lines) { nassertv(num_lines >= 1); _num_lines = num_lines; @@ -149,18 +149,18 @@ set_num_lines(int num_lines) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_num_lines +// Function: PGEntry::get_num_lines // Access: Published -// Description: Returns the number of lines of text the qpPGEntry will +// Description: Returns the number of lines of text the PGEntry will // use, if _max_width is not 0. See set_num_lines(). //////////////////////////////////////////////////////////////////// -INLINE int qpPGEntry:: +INLINE int PGEntry:: get_num_lines() const { return _num_lines; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_blink_rate +// Function: PGEntry::set_blink_rate // Access: Published // Description: Sets the number of times per second the cursor will // blink while the entry has keyboard focus. @@ -168,72 +168,72 @@ get_num_lines() const { // If this is 0, the cursor does not blink, but is held // steady. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_blink_rate(float blink_rate) { _blink_rate = blink_rate; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_blink_rate +// Function: PGEntry::get_blink_rate // Access: Published // Description: Returns the number of times per second the cursor // will blink, or 0 if the cursor is not to blink. //////////////////////////////////////////////////////////////////// -INLINE float qpPGEntry:: +INLINE float PGEntry:: get_blink_rate() const { return _blink_rate; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_cursor_def +// Function: PGEntry::get_cursor_def // Access: Published // Description: Returns the Node that will be rendered to represent // the cursor. You can attach suitable cursor geometry // to this node. //////////////////////////////////////////////////////////////////// -INLINE const qpNodePath &qpPGEntry:: +INLINE const NodePath &PGEntry:: get_cursor_def() { return _cursor_def; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::clear_cursor_def +// Function: PGEntry::clear_cursor_def // Access: Published // Description: Removes all the children from the cursor_def node, in // preparation for adding a new definition. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: clear_cursor_def() { _cursor_def.remove_node(); _cursor_def = _text_render_root.attach_new_node("cursor"); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_cursor_keys_active +// Function: PGEntry::set_cursor_keys_active // Access: Published // Description: Sets whether the arrow keys (and home/end) control // movement of the cursor. If true, they are active; if // false, they are ignored. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_cursor_keys_active(bool flag) { _cursor_keys_active = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_cursor_keys_active +// Function: PGEntry::get_cursor_keys_active // Access: Published // Description: Returns whether the arrow keys are currently set to // control movement of the cursor; see // set_cursor_keys_active(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGEntry:: +INLINE bool PGEntry:: get_cursor_keys_active() const { return _cursor_keys_active; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_obscure_mode +// Function: PGEntry::set_obscure_mode // Access: Published // Description: Specifies whether obscure mode should be enabled. In // obscure mode, a string of asterisks is displayed @@ -246,7 +246,7 @@ get_cursor_keys_active() const { // on the maximum length of text that may be entered if // max_width is in effect. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_obscure_mode(bool flag) { if (_obscure_mode != flag) { _obscure_mode = flag; @@ -255,117 +255,117 @@ set_obscure_mode(bool flag) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_obscure_mode +// Function: PGEntry::get_obscure_mode // Access: Published // Description: Specifies whether obscure mode is enabled. See // set_obscure_mode(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGEntry:: +INLINE bool PGEntry:: get_obscure_mode() const { return _obscure_mode; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_accept_prefix +// Function: PGEntry::get_accept_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the accept // event for all PGEntries. The accept event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_accept_prefix() { return "accept-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_overflow_prefix +// Function: PGEntry::get_overflow_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the overflow // event for all PGEntries. The overflow event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_overflow_prefix() { return "overflow-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_type_prefix +// Function: PGEntry::get_type_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the type // event for all PGEntries. The type event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_type_prefix() { return "type-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_erase_prefix +// Function: PGEntry::get_erase_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the erase // event for all PGEntries. The erase event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_erase_prefix() { return "erase-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_accept_event +// Function: PGEntry::get_accept_event // Access: Published // Description: Returns the event name that will be thrown when the // entry is accepted normally. //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_accept_event(const ButtonHandle &button) const { return "accept-" + button.get_name() + "-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_overflow_event +// Function: PGEntry::get_overflow_event // Access: Published // Description: Returns the event name that will be thrown when too // much text is attempted to be entered into the -// qpPGEntry, exceeding either the limit set via +// PGEntry, exceeding either the limit set via // set_max_chars() or via set_max_width(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_overflow_event() const { return "overflow-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_type_event +// Function: PGEntry::get_type_event // Access: Published // Description: Returns the event name that will be thrown whenever // the user extends the text by typing. //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_type_event() const { return "type-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_erase_event +// Function: PGEntry::get_erase_event // Access: Published // Description: Returns the event name that will be thrown whenever // the user erases characters in the text. //////////////////////////////////////////////////////////////////// -INLINE string qpPGEntry:: +INLINE string PGEntry:: get_erase_event() const { return "erase-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_wtext +// Function: PGEntry::set_wtext // Access: Public // Description: Changes the text currently displayed within the // entry. //////////////////////////////////////////////////////////////////// -INLINE void qpPGEntry:: +INLINE void PGEntry:: set_wtext(const wstring &wtext) { _wtext = wtext; _text_geom_stale = true; @@ -374,12 +374,12 @@ set_wtext(const wstring &wtext) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_wtext +// Function: PGEntry::get_wtext // Access: Public // Description: Returns the text currently displayed within the // entry. //////////////////////////////////////////////////////////////////// -INLINE const wstring &qpPGEntry:: +INLINE const wstring &PGEntry:: get_wtext() const { return _wtext; } diff --git a/panda/src/pgui/qppgEntry.cxx b/panda/src/pgui/pgEntry.cxx similarity index 88% rename from panda/src/pgui/qppgEntry.cxx rename to panda/src/pgui/pgEntry.cxx index 72e27c17ac..7c3bcce3c0 100644 --- a/panda/src/pgui/qppgEntry.cxx +++ b/panda/src/pgui/pgEntry.cxx @@ -1,4 +1,4 @@ -// Filename: qppgEntry.cxx +// Filename: pgEntry.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,42 +16,42 @@ // //////////////////////////////////////////////////////////////////// -#include "qppgEntry.h" +#include "pgEntry.h" #include "pgMouseWatcherParameter.h" -#include "qpcullTraverser.h" +#include "cullTraverser.h" #include "cullTraverserData.h" #include "throw_event.h" #include "transformState.h" #include "mouseWatcherParameter.h" #include "keyboardButton.h" #include "mouseButton.h" -#include "qplineSegs.h" +#include "lineSegs.h" #include -TypeHandle qpPGEntry::_type_handle; +TypeHandle PGEntry::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::Constructor +// Function: PGEntry::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpPGEntry:: -qpPGEntry(const string &name) : - qpPGItem(name) +PGEntry:: +PGEntry(const string &name) : + PGItem(name) { _cursor_position = 0; _cursor_stale = true; _max_chars = 0; _max_width = 0.0f; _num_lines = 1; - _last_text_def = (qpTextNode *)NULL; + _last_text_def = (TextNode *)NULL; _text_geom_stale = true; _blink_start = 0.0f; _blink_rate = 1.0f; - _text_render_root = qpNodePath("text_root"); + _text_render_root = NodePath("text_root"); _cursor_def = _text_render_root.attach_new_node("cursor"); _cursor_visible = true; @@ -63,22 +63,22 @@ qpPGEntry(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::Destructor +// Function: PGEntry::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpPGEntry:: -~qpPGEntry() { +PGEntry:: +~PGEntry() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::Copy Constructor +// Function: PGEntry::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpPGEntry:: -qpPGEntry(const qpPGEntry ©) : - qpPGItem(copy), +PGEntry:: +PGEntry(const PGEntry ©) : + PGItem(copy), _wtext(copy._wtext), _obscured_wtext(copy._obscured_wtext), _cursor_position(copy._cursor_position), @@ -91,25 +91,25 @@ qpPGEntry(const qpPGEntry ©) : _obscure_mode(copy._obscure_mode) { _cursor_stale = true; - _last_text_def = (qpTextNode *)NULL; + _last_text_def = (TextNode *)NULL; _text_geom_stale = true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::make_copy +// Function: PGEntry::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpPGEntry:: +PandaNode *PGEntry:: make_copy() const { - return new qpPGEntry(*this); + return new PGEntry(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::has_cull_callback +// Function: PGEntry::has_cull_callback // Access: Protected, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -117,13 +117,13 @@ make_copy() const { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpPGEntry:: +bool PGEntry:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::cull_callback +// Function: PGEntry::cull_callback // Access: Protected, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -141,9 +141,9 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpPGEntry:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { - qpPGItem::cull_callback(trav, data); +bool PGEntry:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { + PGItem::cull_callback(trav, data); update_text(); update_cursor(); @@ -156,13 +156,13 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::press +// Function: PGEntry::press // Access: Public, Virtual // Description: This is a callback hook function, called whenever a // mouse or keyboard entry is depressed while the mouse // is within the region. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: press(const MouseWatcherParameter ¶m, bool background) { if (get_active()) { if (param.has_button()) { @@ -264,7 +264,7 @@ press(const MouseWatcherParameter ¶m, bool background) { // Check the length. bool too_long = false; if (_max_width > 0.0f) { - qpTextNode *text_node = get_text_def(S_focus); + TextNode *text_node = get_text_def(S_focus); if (_num_lines <= 1) { // If we have only one line, we can check the length // by simply measuring the width of the text. @@ -338,16 +338,16 @@ press(const MouseWatcherParameter ¶m, bool background) { } } } - qpPGItem::press(param, background); + PGItem::press(param, background); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::keystroke +// Function: PGEntry::keystroke // Access: Public, Virtual // Description: This is a callback hook function, called whenever // the user types a key. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: keystroke(const MouseWatcherParameter ¶m, bool background) { if (get_active()) { if (param.has_keycode()) { @@ -380,7 +380,7 @@ keystroke(const MouseWatcherParameter ¶m, bool background) { // Check the length. bool too_long = false; if (_max_width > 0.0f) { - qpTextNode *text_node = get_text_def(S_focus); + TextNode *text_node = get_text_def(S_focus); if (_num_lines <= 1) { // If we have only one line, we can check the length // by simply measuring the width of the text. @@ -453,16 +453,16 @@ keystroke(const MouseWatcherParameter ¶m, bool background) { } } } - qpPGItem::keystroke(param, background); + PGItem::keystroke(param, background); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::accept +// Function: PGEntry::accept // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // entry is accepted by the user pressing Enter normally. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: accept(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_accept_event(param.get_button()); @@ -472,14 +472,14 @@ accept(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::overflow +// Function: PGEntry::overflow // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // entry is overflowed because the user attempts to type // too many characters, exceeding either set_max_chars() // or set_max_width(). //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: overflow(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_overflow_event(); @@ -488,12 +488,12 @@ overflow(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::type +// Function: PGEntry::type // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // user extends the text by typing. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: type(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_type_event(); @@ -502,12 +502,12 @@ type(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::erase +// Function: PGEntry::erase // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // user erase characters in the text. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: erase(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_erase_event(); @@ -516,15 +516,15 @@ erase(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::setup +// Function: PGEntry::setup // Access: Published // Description: Sets up the entry for normal use. The width is the // maximum width of characters that will be typed, and // num_lines is the integer number of lines of text of // the entry. Both of these together determine the size -// of the entry, based on the qpTextNode in effect. +// of the entry, based on the TextNode in effect. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: setup(float width, int num_lines) { set_text(string()); _cursor_position = 0; @@ -532,7 +532,7 @@ setup(float width, int num_lines) { set_max_width(width); set_num_lines(num_lines); - qpTextNode *text_node = get_text_def(S_focus); + TextNode *text_node = get_text_def(S_focus); float line_height = text_node->get_line_height(); // Define determine the four corners of the frame. @@ -541,7 +541,7 @@ setup(float width, int num_lines) { LPoint3f lr(ur[0], 0.0f, ll[2]); LPoint3f ul(ll[0], 0.0f, ur[2]); - // Transform each corner by the qpTextNode's transform. + // Transform each corner by the TextNode's transform. LMatrix4f mat = text_node->get_transform(); ll = ll * mat; ur = ur * mat; @@ -558,16 +558,16 @@ setup(float width, int num_lines) { frame[3] = max(max(ll[2], ur[2]), max(lr[2], ul[2])); switch (text_node->get_align()) { - case qpTextNode::A_left: + case TextNode::A_left: // The default case. break; - case qpTextNode::A_center: + case TextNode::A_center: frame[0] = -width / 2.0; frame[1] = width / 2.0; break; - case qpTextNode::A_right: + case TextNode::A_right: frame[0] = -width; frame[1] = 0.0f; break; @@ -591,7 +591,7 @@ setup(float width, int num_lines) { // Set up a default cursor: a vertical bar. clear_cursor_def(); - qpLineSegs ls; + LineSegs ls; ls.set_color(0.0f, 0.0f, 0.0f, 1.0f); ls.move_to(0.0f, 0.0f, -0.15f * line_height); ls.draw_to(0.0f, 0.0f, 0.85f * line_height); @@ -605,23 +605,23 @@ setup(float width, int num_lines) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_text_def +// Function: PGEntry::set_text_def // Access: Published -// Description: Changes the qpTextNode that will be used to render the +// Description: Changes the TextNode that will be used to render the // text within the entry when the entry is in the // indicated state. The default if nothing is specified -// is the same qpTextNode returned by -// qpPGItem::get_text_node(). +// is the same TextNode returned by +// PGItem::get_text_node(). // // It is the responsibility of the user to ensure that -// this qpTextNode has been frozen by a call to freeze(). -// Passing in an unfrozen qpTextNode will result in +// this TextNode has been frozen by a call to freeze(). +// Passing in an unfrozen TextNode will result in // needless work. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: -set_text_def(int state, qpTextNode *node) { +void PGEntry:: +set_text_def(int state, TextNode *node) { nassertv(state >= 0 && state < 1000); // Sanity check. - if (node == (qpTextNode *)NULL && state >= (int)_text_defs.size()) { + if (node == (TextNode *)NULL && state >= (int)_text_defs.size()) { // If we're setting it to NULL, we don't need to slot a new one. return; } @@ -631,58 +631,58 @@ set_text_def(int state, qpTextNode *node) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_text_def +// Function: PGEntry::get_text_def // Access: Published -// Description: Returns the qpTextNode that will be used to render the +// Description: Returns the TextNode that will be used to render the // text within the entry when the entry is in the // indicated state. See set_text_def(). //////////////////////////////////////////////////////////////////// -qpTextNode *qpPGEntry:: +TextNode *PGEntry:: get_text_def(int state) const { if (state < 0 || state >= (int)_text_defs.size()) { // If we don't have a definition, use the global one. return get_text_node(); } - if (_text_defs[state] == (qpTextNode *)NULL) { + if (_text_defs[state] == (TextNode *)NULL) { return get_text_node(); } return _text_defs[state]; } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_active +// Function: PGEntry::set_active // Access: Published, Virtual // Description: Toggles the active/inactive state of the entry. In -// the case of a qpPGEntry, this also changes its visual +// the case of a PGEntry, this also changes its visual // appearance. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: set_active(bool active) { - qpPGItem::set_active(active); + PGItem::set_active(active); update_state(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::set_focus +// Function: PGEntry::set_focus // Access: Published, Virtual // Description: Toggles the focus state of the entry. In the case of -// a qpPGEntry, this also changes its visual appearance. +// a PGEntry, this also changes its visual appearance. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: set_focus(bool focus) { - qpPGItem::set_focus(focus); + PGItem::set_focus(focus); _blink_start = ClockObject::get_global_clock()->get_frame_time(); update_state(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::get_display_wtext +// Function: PGEntry::get_display_wtext // Access: Private // Description: Returns the string that should be displayed within // the entry. This is normally _wtext, but it may be // _obscured_wtext. //////////////////////////////////////////////////////////////////// -const wstring &qpPGEntry:: +const wstring &PGEntry:: get_display_wtext() { if (_obscure_mode) { // If obscure mode is enabled, we should just display a bunch of @@ -704,28 +704,28 @@ get_display_wtext() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::slot_text_def +// Function: PGEntry::slot_text_def // Access: Private // Description: Ensures there is a slot in the array for the given // text definition. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: slot_text_def(int state) { while (state >= (int)_text_defs.size()) { - _text_defs.push_back((qpTextNode *)NULL); + _text_defs.push_back((TextNode *)NULL); } } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::update_text +// Function: PGEntry::update_text // Access: Private -// Description: Causes the qpPGEntry to recompute its text, if +// Description: Causes the PGEntry to recompute its text, if // necessary. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: update_text() { - qpTextNode *node = get_text_def(get_state()); - nassertv(node != (qpTextNode *)NULL); + TextNode *node = get_text_def(get_state()); + nassertv(node != (TextNode *)NULL); if (_text_geom_stale || node != _last_text_def) { const wstring &display_wtext = get_display_wtext(); @@ -749,7 +749,7 @@ update_text() { // Get the left edge of the text at this line. line._left = 0.0f; - if (_last_text_def->get_align() != qpTextNode::A_left) { + if (_last_text_def->get_align() != TextNode::A_left) { _last_text_def->set_wtext(line._str); line._left = _last_text_def->get_left(); } @@ -763,7 +763,7 @@ update_text() { // Get the left edge of the text at this line. line._left = 0.0f; - if (_last_text_def->get_align() != qpTextNode::A_left) { + if (_last_text_def->get_align() != TextNode::A_left) { _last_text_def->set_wtext(line._str); line._left = _last_text_def->get_left(); } @@ -792,14 +792,14 @@ update_text() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::update_cursor +// Function: PGEntry::update_cursor // Access: Private // Description: Moves the cursor to its correct position. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: update_cursor() { - qpTextNode *node = get_text_def(get_state()); - nassertv(node != (qpTextNode *)NULL); + TextNode *node = get_text_def(get_state()); + nassertv(node != (TextNode *)NULL); if (_cursor_stale || node != _last_text_def) { update_text(); @@ -841,12 +841,12 @@ update_cursor() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::show_hide_cursor +// Function: PGEntry::show_hide_cursor // Access: Private // Description: Makes the cursor visible or invisible, e.g. during a // blink cycle. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: show_hide_cursor(bool visible) { if (visible != _cursor_visible) { if (visible) { @@ -859,12 +859,12 @@ show_hide_cursor(bool visible) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGEntry::update_state +// Function: PGEntry::update_state // Access: Private -// Description: Determines what the correct state for the qpPGEntry +// Description: Determines what the correct state for the PGEntry // should be. //////////////////////////////////////////////////////////////////// -void qpPGEntry:: +void PGEntry:: update_state() { if (get_active()) { if (get_focus()) { diff --git a/panda/src/pgui/qppgEntry.h b/panda/src/pgui/pgEntry.h similarity index 84% rename from panda/src/pgui/qppgEntry.h rename to panda/src/pgui/pgEntry.h index f282f1211f..1974d6352e 100644 --- a/panda/src/pgui/qppgEntry.h +++ b/panda/src/pgui/pgEntry.h @@ -1,4 +1,4 @@ -// Filename: qppgEntry.h +// Filename: pgEntry.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,25 +16,25 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPGENTRY_H -#define qpPGENTRY_H +#ifndef PGENTRY_H +#define PGENTRY_H #include "pandabase.h" -#include "qppgItem.h" +#include "pgItem.h" -#include "qptextNode.h" +#include "textNode.h" #include "pointerTo.h" #include "pvector.h" #include "clockObject.h" //////////////////////////////////////////////////////////////////// -// Class : qpPGEntry +// Class : PGEntry // Description : This is a particular kind of PGItem that handles // simple one-line text entries, of the sort where the // user can type any string. // -// A qpPGEntry does all of its internal manipulation on a +// A PGEntry does all of its internal manipulation on a // wide string, so it can store the full Unicode // character set. The interface can support either the // wide string getters and setters, or the normal 8-bit @@ -42,18 +42,18 @@ // encoding method is specified by the associated // TextNode. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPGEntry : public qpPGItem { +class EXPCL_PANDA PGEntry : public PGItem { PUBLISHED: - qpPGEntry(const string &name); - virtual ~qpPGEntry(); + PGEntry(const string &name); + virtual ~PGEntry(); protected: - qpPGEntry(const qpPGEntry ©); + PGEntry(const PGEntry ©); public: virtual PandaNode *make_copy() const; virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual void press(const MouseWatcherParameter ¶m, bool background); virtual void keystroke(const MouseWatcherParameter ¶m, bool background); @@ -88,7 +88,7 @@ PUBLISHED: INLINE void set_blink_rate(float blink_rate); INLINE float get_blink_rate() const; - INLINE const qpNodePath &get_cursor_def(); + INLINE const NodePath &get_cursor_def(); INLINE void clear_cursor_def(); INLINE void set_cursor_keys_active(bool flag); @@ -97,8 +97,8 @@ PUBLISHED: INLINE void set_obscure_mode(bool flag); INLINE bool get_obscure_mode() const; - void set_text_def(int state, qpTextNode *node); - qpTextNode *get_text_def(int state) const; + void set_text_def(int state, TextNode *node); + TextNode *get_text_def(int state) const; virtual void set_active(bool active); virtual void set_focus(bool focus); @@ -136,16 +136,16 @@ private: float _max_width; int _num_lines; - typedef pvector< PT(qpTextNode) > TextDefs; + typedef pvector< PT(TextNode) > TextDefs; TextDefs _text_defs; // This is the subgraph that renders both the text and the cursor. - qpNodePath _text_render_root; + NodePath _text_render_root; // This is the node for rendering the actual text that is parented // to the above node when the text is generated. - qpNodePath _current_text; - qpTextNode *_last_text_def; + NodePath _current_text; + TextNode *_last_text_def; bool _text_geom_stale; // This is a list of each row of text in the entry, after it has @@ -162,7 +162,7 @@ private: // This is the node that represents the cursor geometry. It is also // attached to the above node, and is transformed around and/or // hidden according to the cursor's position and blink state. - qpNodePath _cursor_def; + NodePath _cursor_def; double _blink_start; double _blink_rate; @@ -175,9 +175,9 @@ public: return _type_handle; } static void init_type() { - qpPGItem::init_type(); - register_type(_type_handle, "qpPGEntry", - qpPGItem::get_class_type()); + PGItem::init_type(); + register_type(_type_handle, "PGEntry", + PGItem::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -188,6 +188,6 @@ private: static TypeHandle _type_handle; }; -#include "qppgEntry.I" +#include "pgEntry.I" #endif diff --git a/panda/src/pgui/pgFrameStyle.cxx b/panda/src/pgui/pgFrameStyle.cxx index 4d9a2c2371..5c402dfc2b 100644 --- a/panda/src/pgui/pgFrameStyle.cxx +++ b/panda/src/pgui/pgFrameStyle.cxx @@ -19,11 +19,11 @@ #include "pgFrameStyle.h" #include "geomTristrip.h" #include "geomTrifan.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "pandaNode.h" #include "transparencyAttrib.h" #include "pointerTo.h" -#include "qpnodePath.h" +#include "nodePath.h" ostream & operator << (ostream &out, PGFrameStyle::Type type) { @@ -109,32 +109,32 @@ xform(const LMatrix4f &mat) { // The return value is the generated NodePath, if any, // or an empty NodePath if nothing is generated. //////////////////////////////////////////////////////////////////// -qpNodePath PGFrameStyle:: -generate_into(const qpNodePath &parent, const LVecBase4f &frame) { +NodePath PGFrameStyle:: +generate_into(const NodePath &parent, const LVecBase4f &frame) { PT(PandaNode) new_node; switch (_type) { case T_none: - return qpNodePath(); + return NodePath(); case T_flat: - new_node = qpgenerate_flat_geom(frame); + new_node = generate_flat_geom(frame); break; case T_bevel_out: - new_node = qpgenerate_bevel_geom(frame, false); + new_node = generate_bevel_geom(frame, false); break; case T_bevel_in: - new_node = qpgenerate_bevel_geom(frame, true); + new_node = generate_bevel_geom(frame, true); break; case T_groove: - new_node = qpgenerate_groove_geom(frame, true); + new_node = generate_groove_geom(frame, true); break; case T_ridge: - new_node = qpgenerate_groove_geom(frame, false); + new_node = generate_groove_geom(frame, false); break; default: @@ -151,14 +151,14 @@ generate_into(const qpNodePath &parent, const LVecBase4f &frame) { } //////////////////////////////////////////////////////////////////// -// Function: PGFrameStyle::qpgenerate_flat_geom +// Function: PGFrameStyle::generate_flat_geom // Access: Private -// Description: Generates the qpGeomNode appropriate to a T_flat +// Description: Generates the GeomNode appropriate to a T_flat // frame. //////////////////////////////////////////////////////////////////// PT(PandaNode) PGFrameStyle:: -qpgenerate_flat_geom(const LVecBase4f &frame) { - PT(qpGeomNode) gnode = new qpGeomNode("flat"); +generate_flat_geom(const LVecBase4f &frame) { + PT(GeomNode) gnode = new GeomNode("flat"); Geom *geom = new GeomTristrip; gnode->add_geom(geom); @@ -189,13 +189,13 @@ qpgenerate_flat_geom(const LVecBase4f &frame) { } //////////////////////////////////////////////////////////////////// -// Function: PGFrameStyle::qpgenerate_bevel_geom +// Function: PGFrameStyle::generate_bevel_geom // Access: Private -// Description: Generates the qpGeomNode appropriate to a T_bevel_in or +// Description: Generates the GeomNode appropriate to a T_bevel_in or // T_bevel_out frame. //////////////////////////////////////////////////////////////////// PT(PandaNode) PGFrameStyle:: -qpgenerate_bevel_geom(const LVecBase4f &frame, bool in) { +generate_bevel_geom(const LVecBase4f &frame, bool in) { // // Colors: // @@ -253,7 +253,7 @@ qpgenerate_bevel_geom(const LVecBase4f &frame, bool in) { // * * // 0 - PT(qpGeomNode) gnode = new qpGeomNode("bevel"); + PT(GeomNode) gnode = new GeomNode("bevel"); float left = frame[0]; float right = frame[1]; @@ -349,13 +349,13 @@ qpgenerate_bevel_geom(const LVecBase4f &frame, bool in) { } //////////////////////////////////////////////////////////////////// -// Function: PGFrameStyle::qpgenerate_groove_geom +// Function: PGFrameStyle::generate_groove_geom // Access: Private -// Description: Generates the qpGeomNode appropriate to a T_groove or +// Description: Generates the GeomNode appropriate to a T_groove or // T_ridge frame. //////////////////////////////////////////////////////////////////// PT(PandaNode) PGFrameStyle:: -qpgenerate_groove_geom(const LVecBase4f &frame, bool in) { +generate_groove_geom(const LVecBase4f &frame, bool in) { // // Colors: // @@ -454,7 +454,7 @@ qpgenerate_groove_geom(const LVecBase4f &frame, bool in) { // * * // 0 - PT(qpGeomNode) gnode = new qpGeomNode("groove"); + PT(GeomNode) gnode = new GeomNode("groove"); float left = frame[0]; float right = frame[1]; diff --git a/panda/src/pgui/pgFrameStyle.h b/panda/src/pgui/pgFrameStyle.h index 977d4abba4..f6144afc09 100644 --- a/panda/src/pgui/pgFrameStyle.h +++ b/panda/src/pgui/pgFrameStyle.h @@ -24,7 +24,7 @@ #include "luse.h" class PandaNode; -class qpNodePath; +class NodePath; //////////////////////////////////////////////////////////////////// // Class : PGFrameStyle @@ -62,12 +62,12 @@ PUBLISHED: public: bool xform(const LMatrix4f &mat); - qpNodePath generate_into(const qpNodePath &parent, const LVecBase4f &frame); + NodePath generate_into(const NodePath &parent, const LVecBase4f &frame); private: - PT(PandaNode) qpgenerate_flat_geom(const LVecBase4f &frame); - PT(PandaNode) qpgenerate_bevel_geom(const LVecBase4f &frame, bool in); - PT(PandaNode) qpgenerate_groove_geom(const LVecBase4f &frame, bool in); + PT(PandaNode) generate_flat_geom(const LVecBase4f &frame); + PT(PandaNode) generate_bevel_geom(const LVecBase4f &frame, bool in); + PT(PandaNode) generate_groove_geom(const LVecBase4f &frame, bool in); private: Type _type; diff --git a/panda/src/pgui/qppgItem.I b/panda/src/pgui/pgItem.I similarity index 79% rename from panda/src/pgui/qppgItem.I rename to panda/src/pgui/pgItem.I index dcfd631474..a426cbec47 100644 --- a/panda/src/pgui/qppgItem.I +++ b/panda/src/pgui/pgItem.I @@ -1,4 +1,4 @@ -// Filename: qppgItem.I +// Filename: pgItem.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,23 +18,23 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_region +// Function: PGItem::get_region // Access: Public // Description: Returns the MouseWatcherRegion associated with this -// item. Every qpPGItem has a MouseWatcherRegion -// associated with it, that is created when the qpPGItem +// item. Every PGItem has a MouseWatcherRegion +// associated with it, that is created when the PGItem // is created; it does not change during the lifetime of -// the qpPGItem. Even items that do not have a frame have +// the PGItem. Even items that do not have a frame have // an associated MouseWatcherRegion, although it will // not be used in this case. //////////////////////////////////////////////////////////////////// -INLINE PGMouseWatcherRegion *qpPGItem:: +INLINE PGMouseWatcherRegion *PGItem:: get_region() const { return _region; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_frame +// Function: PGItem::set_frame // Access: Published // Description: Sets the bounding rectangle of the item, in local // coordinates. This is the region on screen within @@ -42,13 +42,13 @@ get_region() const { // item. Normally, it should correspond to the bounding // rectangle of the visible geometry of the item. //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: set_frame(float left, float right, float bottom, float top) { set_frame(LVecBase4f(left, right, bottom, top)); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_frame +// Function: PGItem::set_frame // Access: Published // Description: Sets the bounding rectangle of the item, in local // coordinates. This is the region on screen within @@ -56,7 +56,7 @@ set_frame(float left, float right, float bottom, float top) { // item. Normally, it should correspond to the bounding // rectangle of the visible geometry of the item. //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: set_frame(const LVecBase4f &frame) { _has_frame = true; _frame = frame; @@ -64,298 +64,298 @@ set_frame(const LVecBase4f &frame) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_frame +// Function: PGItem::get_frame // Access: Published // Description: Returns the bounding rectangle of the item. See // set_frame(). It is an error to call this if // has_frame() returns false. //////////////////////////////////////////////////////////////////// -INLINE const LVecBase4f &qpPGItem:: +INLINE const LVecBase4f &PGItem:: get_frame() const { nassertr(has_frame(), _frame); return _frame; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::has_frame +// Function: PGItem::has_frame // Access: Published // Description: Returns true if the item has a bounding rectangle; // see set_frame(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGItem:: +INLINE bool PGItem:: has_frame() const { return _has_frame; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::clear_frame +// Function: PGItem::clear_frame // Access: Published // Description: Removes the bounding rectangle from the item. It // will no longer be possible to position the mouse // within the item; see set_frame(). //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: clear_frame() { _has_frame = false; mark_frames_stale(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_state +// Function: PGItem::set_state // Access: Published -// Description: Sets the "state" of this particular qpPGItem. +// Description: Sets the "state" of this particular PGItem. // -// The qpPGItem node will render as if it were the +// The PGItem node will render as if it were the // subgraph assigned to the corresponding index via // set_state_def(). //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: set_state(int state) { _state = state; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_state +// Function: PGItem::get_state // Access: Published -// Description: Returns the "state" of this particular qpPGItem. See +// Description: Returns the "state" of this particular PGItem. See // set_state(). //////////////////////////////////////////////////////////////////// -INLINE int qpPGItem:: +INLINE int PGItem:: get_state() const { return _state; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_active +// Function: PGItem::get_active // Access: Published -// Description: Returns whether the qpPGItem is currently active for +// Description: Returns whether the PGItem is currently active for // mouse events. See set_active(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGItem:: +INLINE bool PGItem:: get_active() const { return (_flags & F_active) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus +// Function: PGItem::get_focus // Access: Published -// Description: Returns whether the qpPGItem currently has focus for +// Description: Returns whether the PGItem currently has focus for // keyboard events. See set_focus(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGItem:: +INLINE bool PGItem:: get_focus() const { return (_flags & F_focus) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_background_focus +// Function: PGItem::get_background_focus // Access: Published // Description: Returns whether background_focus is currently // enabled. See set_background_focus(). //////////////////////////////////////////////////////////////////// -INLINE bool qpPGItem:: +INLINE bool PGItem:: get_background_focus() const { return (_flags & F_background_focus) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_suppress_flags +// Function: PGItem::set_suppress_flags // Access: Published // Description: This is just an interface to set the suppress flags // on the underlying MouseWatcherRegion. See // MouseWatcherRegion::set_suppress_flags(). //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: set_suppress_flags(int suppress_flags) { _region->set_suppress_flags(suppress_flags); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_suppress_flags +// Function: PGItem::get_suppress_flags // Access: Published // Description: This is just an interface to get the suppress flags // on the underlying MouseWatcherRegion. See // MouseWatcherRegion::get_suppress_flags(). //////////////////////////////////////////////////////////////////// -INLINE int qpPGItem:: +INLINE int PGItem:: get_suppress_flags() const { return _region->get_suppress_flags(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_id +// Function: PGItem::get_id // Access: Published -// Description: Returns the unique ID assigned to this qpPGItem. This +// Description: Returns the unique ID assigned to this PGItem. This // will be assigned to the region created with the // MouseWatcher, and will thus be used to generate event // names. //////////////////////////////////////////////////////////////////// -INLINE const string &qpPGItem:: +INLINE const string &PGItem:: get_id() const { return _region->get_name(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_id +// Function: PGItem::set_id // Access: Published -// Description: Set the unique ID assigned to this qpPGItem. It is the +// Description: Set the unique ID assigned to this PGItem. It is the // user's responsibility to ensure that this ID is // unique. // // Normally, this should not need to be called, as the -// qpPGItem will assign itself an ID when it is created, +// PGItem will assign itself an ID when it is created, // but this function allows the user to decide to // redefine the ID to be something possibly more // meaningful. //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: +INLINE void PGItem:: set_id(const string &id) { _region->set_name(id); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_enter_prefix +// Function: PGItem::get_enter_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the enter -// event for all qpPGItems. The enter event is the +// event for all PGItems. The enter event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_enter_prefix() { return "enter-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_exit_prefix +// Function: PGItem::get_exit_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the exit -// event for all qpPGItems. The exit event is the +// event for all PGItems. The exit event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_exit_prefix() { return "exit-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_within_prefix +// Function: PGItem::get_within_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the within -// event for all qpPGItems. The within event is the +// event for all PGItems. The within event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_within_prefix() { return "within-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_without_prefix +// Function: PGItem::get_without_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the without -// event for all qpPGItems. The without event is the +// event for all PGItems. The without event is the // concatenation of this string followed by get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_without_prefix() { return "without-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus_in_prefix +// Function: PGItem::get_focus_in_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the focus_in -// event for all qpPGItems. The focus_in event is the +// event for all PGItems. The focus_in event is the // concatenation of this string followed by get_id(). // // Unlike most item events, this event is thrown with no // parameters. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_focus_in_prefix() { return "fin-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus_out_prefix +// Function: PGItem::get_focus_out_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the focus_out -// event for all qpPGItems. The focus_out event is the +// event for all PGItems. The focus_out event is the // concatenation of this string followed by get_id(). // // Unlike most item events, this event is thrown with no // parameters. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_focus_out_prefix() { return "fout-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_press_prefix +// Function: PGItem::get_press_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the press -// event for all qpPGItems. The press event is the +// event for all PGItems. The press event is the // concatenation of this string followed by a button // name, followed by a hyphen and get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_press_prefix() { return "press-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_release_prefix +// Function: PGItem::get_release_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the release -// event for all qpPGItems. The release event is the +// event for all PGItems. The release event is the // concatenation of this string followed by a button // name, followed by a hyphen and get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_release_prefix() { return "release-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_keystroke_prefix +// Function: PGItem::get_keystroke_prefix // Access: Published, Static // Description: Returns the prefix that is used to define the -// keystroke event for all qpPGItems. The keystroke event +// keystroke event for all PGItems. The keystroke event // is the concatenation of this string followed by a // hyphen and get_id(). //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_keystroke_prefix() { return "keystroke-"; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_enter_event +// Function: PGItem::get_enter_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the mouse enters its frame, but // not any nested frames. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_enter_event() const { return get_enter_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_exit_event +// Function: PGItem::get_exit_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the mouse exits its frame, or // enters a nested frame. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_exit_event() const { return get_exit_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_within_event +// Function: PGItem::get_within_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the mouse moves within the @@ -363,13 +363,13 @@ get_exit_event() const { // enter_event in that the mouse is considered within // the frame even if it is also within a nested frame. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_within_event() const { return get_within_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_without_event +// Function: PGItem::get_without_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the mouse moves completely outside @@ -378,91 +378,91 @@ get_within_event() const { // within the frame even if it is also within a nested // frame. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_without_event() const { return get_without_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus_in_event +// Function: PGItem::get_focus_in_event // Access: Published // Description: Returns the event name that will be thrown when the // item gets the keyboard focus. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_focus_in_event() const { return get_focus_in_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus_out_event +// Function: PGItem::get_focus_out_event // Access: Published // Description: Returns the event name that will be thrown when the // item loses the keyboard focus. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_focus_out_event() const { return get_focus_out_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_press_event +// Function: PGItem::get_press_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the indicated mouse or keyboard // button is depressed while the mouse is within the // frame. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_press_event(const ButtonHandle &button) const { return get_press_prefix() + button.get_name() + "-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_release_event +// Function: PGItem::get_release_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and the indicated mouse or keyboard // button, formerly clicked down is within the frame, is // released. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_release_event(const ButtonHandle &button) const { return get_release_prefix() + button.get_name() + "-" + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_keystroke_event +// Function: PGItem::get_keystroke_event // Access: Published // Description: Returns the event name that will be thrown when the // item is active and any key is pressed by the user. //////////////////////////////////////////////////////////////////// -INLINE string qpPGItem:: +INLINE string PGItem:: get_keystroke_event() const { return get_keystroke_prefix() + get_id(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_text_node +// Function: PGItem::set_text_node // Access: Published, Static // Description: Changes the TextNode object that will be used by all -// qpPGItems to generate default labels given a string. +// PGItems to generate default labels given a string. // This can be loaded with the default font, etc. //////////////////////////////////////////////////////////////////// -INLINE void qpPGItem:: -set_text_node(qpTextNode *node) { +INLINE void PGItem:: +set_text_node(TextNode *node) { _text_node = node; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_focus_item +// Function: PGItem::get_focus_item // Access: Published, Static -// Description: Returns the one qpPGItem in the world that currently +// Description: Returns the one PGItem in the world that currently // has keyboard focus, if any, or NULL if no item has -// keyboard focus. Use qpPGItem::set_focus() to activate +// keyboard focus. Use PGItem::set_focus() to activate // or deactivate keyboard focus on a particular item. //////////////////////////////////////////////////////////////////// -INLINE qpPGItem *qpPGItem:: +INLINE PGItem *PGItem:: get_focus_item() { return _focus_item; } diff --git a/panda/src/pgui/qppgItem.cxx b/panda/src/pgui/pgItem.cxx similarity index 85% rename from panda/src/pgui/qppgItem.cxx rename to panda/src/pgui/pgItem.cxx index ff4ca990da..5b3e7c1a6d 100644 --- a/panda/src/pgui/qppgItem.cxx +++ b/panda/src/pgui/pgItem.cxx @@ -1,4 +1,4 @@ -// Filename: qppgItem.cxx +// Filename: pgItem.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,17 +16,17 @@ // //////////////////////////////////////////////////////////////////// -#include "qppgItem.h" +#include "pgItem.h" #include "pgMouseWatcherParameter.h" #include "pgCullTraverser.h" #include "config_pgui.h" #include "pandaNode.h" -#include "qpsceneGraphReducer.h" +#include "sceneGraphReducer.h" #include "throw_event.h" #include "string_utils.h" -#include "qpnodePath.h" -#include "qpcullTraverser.h" +#include "nodePath.h" +#include "cullTraverser.h" #include "cullTraverserData.h" #include "dcast.h" @@ -34,18 +34,18 @@ #include "audioSound.h" #endif -TypeHandle qpPGItem::_type_handle; -PT(qpTextNode) qpPGItem::_text_node; -qpPGItem *qpPGItem::_focus_item = (qpPGItem *)NULL; -qpPGItem::BackgroundFocus qpPGItem::_background_focus; +TypeHandle PGItem::_type_handle; +PT(TextNode) PGItem::_text_node; +PGItem *PGItem::_focus_item = (PGItem *)NULL; +PGItem::BackgroundFocus PGItem::_background_focus; //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::Constructor +// Function: PGItem::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpPGItem:: -qpPGItem(const string &name) : +PGItem:: +PGItem(const string &name) : PandaNode(name) { _has_frame = false; @@ -56,28 +56,28 @@ qpPGItem(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::Destructor +// Function: PGItem::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpPGItem:: -~qpPGItem() { - nassertv(_region->_qpitem == this); - _region->_qpitem = (qpPGItem *)NULL; +PGItem:: +~PGItem() { + nassertv(_region->_item == this); + _region->_item = (PGItem *)NULL; set_background_focus(false); if (_focus_item == this) { - _focus_item = (qpPGItem *)NULL; + _focus_item = (PGItem *)NULL; } } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::Copy Constructor +// Function: PGItem::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpPGItem:: -qpPGItem(const qpPGItem ©) : +PGItem:: +PGItem(const PGItem ©) : PandaNode(copy), _has_frame(copy._has_frame), _frame(copy._frame), @@ -88,26 +88,26 @@ qpPGItem(const qpPGItem ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::make_copy +// Function: PGItem::make_copy // Access: Protected, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpPGItem:: +PandaNode *PGItem:: make_copy() const { - return new qpPGItem(*this); + return new PGItem(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::xform +// Function: PGItem::xform // Access: Protected, Virtual // Description: Transforms the contents of this node by the indicated // matrix, if it means anything to do so. For most // kinds of nodes, this does nothing. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: xform(const LMatrix4f &mat) { // Transform the frame. LPoint3f ll(_frame[0], 0.0, _frame[2]); @@ -119,12 +119,12 @@ xform(const LMatrix4f &mat) { // Transform the individual states and their frame styles. StateDefs::iterator di; for (di = _state_defs.begin(); di != _state_defs.end(); ++di) { - qpNodePath &root = (*di)._root; + NodePath &root = (*di)._root; // Apply the matrix to the previous transform. root.set_transform(root.get_transform()->compose(TransformState::make_mat(mat))); // Now flatten the transform into the subgraph. - qpSceneGraphReducer gr; + SceneGraphReducer gr; gr.apply_attribs(root.node()); // Transform the frame style too. @@ -136,7 +136,7 @@ xform(const LMatrix4f &mat) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::has_cull_callback +// Function: PGItem::has_cull_callback // Access: Protected, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -144,13 +144,13 @@ xform(const LMatrix4f &mat) { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpPGItem:: +bool PGItem:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::cull_callback +// Function: PGItem::cull_callback // Access: Protected, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -168,8 +168,8 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpPGItem:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { +bool PGItem:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { if (has_frame() && get_active()) { // The item has a frame, so we want to generate a region for it // and update the MouseWatcher. @@ -192,7 +192,7 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { if (has_state_def(get_state())) { // This item has a current state definition that we should use // to render the item. - qpNodePath &root = get_state_def(get_state()); + NodePath &root = get_state_def(get_state()); CullTraverserData next_data(data, root.node()); trav->traverse(next_data); } @@ -202,14 +202,14 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::recompute_internal_bound +// Function: PGItem::recompute_internal_bound // Access: Protected, Virtual // Description: Called when needed to recompute the node's // _internal_bound object. Nodes that contain anything // of substance should redefine this to do the right // thing. //////////////////////////////////////////////////////////////////// -BoundingVolume *qpPGItem:: +BoundingVolume *PGItem:: recompute_internal_bound() { // First, get ourselves a fresh, empty bounding volume. BoundingVolume *bound = PandaNode::recompute_internal_bound(); @@ -223,7 +223,7 @@ recompute_internal_bound() { // get_state_def() on each one, to ensure that the frames are // updated correctly before we measure their bounding volumes. for (int i = 0; i < (int)_state_defs.size(); i++) { - qpNodePath &root = get_state_def(i); + NodePath &root = get_state_def(i); if (!root.is_empty()) { child_volumes.push_back(&root.node()->get_bound()); } @@ -237,12 +237,12 @@ recompute_internal_bound() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::activate_region +// Function: PGItem::activate_region // Access: Public // Description: Applies the indicated scene graph transform and order // as determined by the traversal from PGTop. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: activate_region(const LMatrix4f &transform, int sort) { // Transform all four vertices, and get the new bounding box. This // way the region works (mostly) even if has been rotated. @@ -264,7 +264,7 @@ activate_region(const LMatrix4f &transform, int sort) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::enter +// Function: PGItem::enter // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse enters the region. The mouse is only @@ -272,7 +272,7 @@ activate_region(const LMatrix4f &transform, int sort) { // in the case of nested regions, it exits the outer // region before entering the inner one. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: enter(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_enter_event(); @@ -281,7 +281,7 @@ enter(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::exit +// Function: PGItem::exit // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse exits the region. The mouse is only considered @@ -289,7 +289,7 @@ enter(const MouseWatcherParameter ¶m) { // of nested regions, it exits the outer region before // entering the inner one. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: exit(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_exit_event(); @@ -298,7 +298,7 @@ exit(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::within +// Function: PGItem::within // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse moves within the boundaries of the region, even @@ -307,7 +307,7 @@ exit(const MouseWatcherParameter ¶m) { // only called whenever the mouse is within only that // region. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: within(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_within_event(); @@ -316,13 +316,13 @@ within(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::without +// Function: PGItem::without // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // mouse moves completely outside the boundaries of the // region. See within(). //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: without(const MouseWatcherParameter ¶m) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); string event = get_without_event(); @@ -331,12 +331,12 @@ without(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::focus_in +// Function: PGItem::focus_in // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // widget gets the keyboard focus. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: focus_in() { string event = get_focus_in_event(); play_sound(event); @@ -344,12 +344,12 @@ focus_in() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::focus_out +// Function: PGItem::focus_out // Access: Public, Virtual // Description: This is a callback hook function, called whenever the // widget loses the keyboard focus. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: focus_out() { string event = get_focus_out_event(); play_sound(event); @@ -357,13 +357,13 @@ focus_out() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::press +// Function: PGItem::press // Access: Public, Virtual // Description: This is a callback hook function, called whenever a // mouse or keyboard button is depressed while the mouse // is within the region. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: press(const MouseWatcherParameter ¶m, bool background) { if (!background) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); @@ -374,13 +374,13 @@ press(const MouseWatcherParameter ¶m, bool background) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::release +// Function: PGItem::release // Access: Public, Virtual // Description: This is a callback hook function, called whenever a // mouse or keyboard button previously depressed with // press() is released. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: release(const MouseWatcherParameter ¶m, bool background) { if (!background) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); @@ -391,12 +391,12 @@ release(const MouseWatcherParameter ¶m, bool background) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::keystroke +// Function: PGItem::keystroke // Access: Public, Virtual // Description: This is a callback hook function, called whenever // the user presses a key. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: keystroke(const MouseWatcherParameter ¶m, bool background) { if (!background) { PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param); @@ -407,16 +407,16 @@ keystroke(const MouseWatcherParameter ¶m, bool background) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::background_press +// Function: PGItem::background_press // Access: Public, Static -// Description: Calls press() on all the qpPGItems with background +// Description: Calls press() on all the PGItems with background // focus. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: background_press(const MouseWatcherParameter ¶m) { BackgroundFocus::const_iterator fi; for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) { - qpPGItem *item = *fi; + PGItem *item = *fi; if (!item->get_focus()) { item->press(param, true); } @@ -424,16 +424,16 @@ background_press(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::background_release +// Function: PGItem::background_release // Access: Public, Static -// Description: Calls release() on all the qpPGItems with background +// Description: Calls release() on all the PGItems with background // focus. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: background_release(const MouseWatcherParameter ¶m) { BackgroundFocus::const_iterator fi; for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) { - qpPGItem *item = *fi; + PGItem *item = *fi; if (!item->get_focus()) { item->release(param, true); } @@ -441,16 +441,16 @@ background_release(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::background_keystroke +// Function: PGItem::background_keystroke // Access: Public, Static -// Description: Calls keystroke() on all the qpPGItems with background +// Description: Calls keystroke() on all the PGItems with background // focus. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: background_keystroke(const MouseWatcherParameter ¶m) { BackgroundFocus::const_iterator fi; for (fi = _background_focus.begin(); fi != _background_focus.end(); ++fi) { - qpPGItem *item = *fi; + PGItem *item = *fi; if (!item->get_focus()) { item->keystroke(param, true); } @@ -458,15 +458,15 @@ background_keystroke(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_active +// Function: PGItem::set_active // Access: Published, Virtual -// Description: Sets whether the qpPGItem is active for mouse watching. +// Description: Sets whether the PGItem is active for mouse watching. // This is not necessarily related to the // active/inactive appearance of the item, which is // controlled by set_state(), but it does affect whether // it responds to mouse events. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: set_active(bool active) { if (active) { _flags |= F_active; @@ -480,19 +480,19 @@ set_active(bool active) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_focus +// Function: PGItem::set_focus // Access: Published, Virtual -// Description: Sets whether the qpPGItem currently has keyboard focus. +// Description: Sets whether the PGItem currently has keyboard focus. // This simply means that the item may respond to // keyboard events as well as to mouse events; precisely // what this means is up to the individual item. // -// Only one qpPGItem in the world is allowed to have focus +// Only one PGItem in the world is allowed to have focus // at any given time. Setting the focus on any other // item automatically disables the focus from the // previous item. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: set_focus(bool focus) { if (focus) { if (!get_active()) { @@ -502,7 +502,7 @@ set_focus(bool focus) { // Set the keyboard focus to this item. if (_focus_item != this) { - if (_focus_item != (qpPGItem *)NULL) { + if (_focus_item != (PGItem *)NULL) { // Clear the focus from whatever item currently has it. _focus_item->set_focus(false); } @@ -516,7 +516,7 @@ set_focus(bool focus) { } else { if (_focus_item == this) { // Remove this item from the focus. - _focus_item = (qpPGItem *)NULL; + _focus_item = (PGItem *)NULL; } if (get_focus()) { @@ -528,7 +528,7 @@ set_focus(bool focus) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_background_focus +// Function: PGItem::set_background_focus // Access: Published // Description: Sets the background_focus flag for this item. When // background_focus is enabled, the item will receive @@ -536,7 +536,7 @@ set_focus(bool focus) { // even if it is not onscreen. Unlike normal focus, // many items may have background_focus simultaneously. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: set_background_focus(bool focus) { if (focus != get_background_focus()) { if (focus) { @@ -555,29 +555,29 @@ set_background_focus(bool focus) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_num_state_defs +// Function: PGItem::get_num_state_defs // Access: Published // Description: Returns one more than the highest-numbered state def -// that was ever assigned to the qpPGItem. The complete +// that was ever assigned to the PGItem. The complete // set of state defs assigned may then be retrieved by // indexing from 0 to (get_num_state_defs() - 1). // // This is only an upper limit on the actual number of // state defs, since there may be holes in the list. //////////////////////////////////////////////////////////////////// -int qpPGItem:: +int PGItem:: get_num_state_defs() const { return _state_defs.size(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::has_state_def +// Function: PGItem::has_state_def // Access: Published // Description: Returns true if get_state_def() has ever been called // for the indicated state (thus defining a render // subgraph for this state index), false otherwise. //////////////////////////////////////////////////////////////////// -bool qpPGItem:: +bool PGItem:: has_state_def(int state) const { if (state < 0 || state >= (int)_state_defs.size()) { return false; @@ -586,41 +586,41 @@ has_state_def(int state) const { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::clear_state_def +// Function: PGItem::clear_state_def // Access: Published // Description: Resets the NodePath assigned to the indicated state // to its initial default, with only a frame // representation if appropriate. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: clear_state_def(int state) { if (state < 0 || state >= (int)_state_defs.size()) { return; } - _state_defs[state]._root = qpNodePath(); - _state_defs[state]._frame = qpNodePath(); + _state_defs[state]._root = NodePath(); + _state_defs[state]._frame = NodePath(); _state_defs[state]._frame_stale = true; mark_bound_stale(); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_state_def +// Function: PGItem::get_state_def // Access: Published // Description: Returns the Node that is the root of the subgraph -// that will be drawn when the qpPGItem is in the +// that will be drawn when the PGItem is in the // indicated state. The first time this is called for a // particular state index, it may create the Node. //////////////////////////////////////////////////////////////////// -qpNodePath &qpPGItem:: +NodePath &PGItem:: get_state_def(int state) { nassertr(state >= 0 && state < 1000, get_state_def(0)); // Sanity check. slot_state_def(state); if (_state_defs[state]._root.is_empty()) { // Create a new node. - _state_defs[state]._root = qpNodePath("state_" + format_string(state)); + _state_defs[state]._root = NodePath("state_" + format_string(state)); _state_defs[state]._frame_stale = true; } @@ -632,16 +632,16 @@ get_state_def(int state) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::instance_to_state_def +// Function: PGItem::instance_to_state_def // Access: Published // Description: Parents an instance of the bottom node of the // indicated NodePath to the indicated state index. //////////////////////////////////////////////////////////////////// -qpNodePath qpPGItem:: -instance_to_state_def(int state, const qpNodePath &path) { +NodePath PGItem:: +instance_to_state_def(int state, const NodePath &path) { if (path.is_empty()) { // If the source is empty, quietly do nothing. - return qpNodePath(); + return NodePath(); } mark_bound_stale(); @@ -650,12 +650,12 @@ instance_to_state_def(int state, const qpNodePath &path) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_frame_style +// Function: PGItem::get_frame_style // Access: Published // Description: Returns the kind of frame that will be drawn behind // the item when it is in the indicated state. //////////////////////////////////////////////////////////////////// -PGFrameStyle qpPGItem:: +PGFrameStyle PGItem:: get_frame_style(int state) { if (state < 0 || state >= (int)_state_defs.size()) { return PGFrameStyle(); @@ -664,16 +664,16 @@ get_frame_style(int state) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_frame_style +// Function: PGItem::set_frame_style // Access: Published // Description: Changes the kind of frame that will be drawn behind // the item when it is in the indicated state. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: set_frame_style(int state, const PGFrameStyle &style) { // Get the state def node, mainly to ensure that this state is // slotted and listed as having been defined. - qpNodePath &root = get_state_def(state); + NodePath &root = get_state_def(state); nassertv(!root.is_empty()); _state_defs[state]._frame_style = style; @@ -684,34 +684,34 @@ set_frame_style(int state, const PGFrameStyle &style) { #ifdef HAVE_AUDIO //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::set_sound +// Function: PGItem::set_sound // Access: Published // Description: Sets the sound that will be played whenever the // indicated event occurs. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: set_sound(const string &event, AudioSound *sound) { _sounds[event] = sound; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::clear_sound +// Function: PGItem::clear_sound // Access: Published // Description: Removes the sound associated with the indicated // event. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: clear_sound(const string &event) { _sounds.erase(event); } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_sound +// Function: PGItem::get_sound // Access: Published // Description: Returns the sound associated with the indicated // event, or NULL if there is no associated sound. //////////////////////////////////////////////////////////////////// -AudioSound *qpPGItem:: +AudioSound *PGItem:: get_sound(const string &event) const { Sounds::const_iterator si = _sounds.find(event); if (si != _sounds.end()) { @@ -721,45 +721,45 @@ get_sound(const string &event) const { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::has_sound +// Function: PGItem::has_sound // Access: Published // Description: Returns true if there is a sound associated with the // indicated event, or false otherwise. //////////////////////////////////////////////////////////////////// -bool qpPGItem:: +bool PGItem:: has_sound(const string &event) const { return (_sounds.count(event) != 0); } #endif // HAVE_AUDIO //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::get_text_node +// Function: PGItem::get_text_node // Access: Published, Static // Description: Returns the TextNode object that will be used by all -// qpPGItems to generate default labels given a string. +// PGItems to generate default labels given a string. // This can be loaded with the default font, etc. //////////////////////////////////////////////////////////////////// -qpTextNode *qpPGItem:: +TextNode *PGItem:: get_text_node() { - if (_text_node == (qpTextNode *)NULL) { - _text_node = new qpTextNode("pguiText"); + if (_text_node == (TextNode *)NULL) { + _text_node = new TextNode("pguiText"); _text_node->freeze(); _text_node->set_text_color(0.0, 0.0, 0.0, 1.0); // The default TextNode is aligned to the left, for the // convenience of PGEntry. - _text_node->set_align(qpTextNode::A_left); + _text_node->set_align(TextNode::A_left); } return _text_node; } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::play_sound +// Function: PGItem::play_sound // Access: Protected // Description: Plays the sound associated with the indicated event, // if there is one. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: play_sound(const string &event) { #ifdef HAVE_AUDIO Sounds::const_iterator si = _sounds.find(event); @@ -771,12 +771,12 @@ play_sound(const string &event) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::slot_state_def +// Function: PGItem::slot_state_def // Access: Private // Description: Ensures there is a slot in the array for the given // state definition. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: slot_state_def(int state) { while (state >= (int)_state_defs.size()) { StateDef def; @@ -786,12 +786,12 @@ slot_state_def(int state) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::update_frame +// Function: PGItem::update_frame // Access: Private // Description: Generates a new instance of the frame geometry for // the indicated state. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: update_frame(int state) { // First, remove the old frame geometry, if any. if (state >= 0 && state < (int)_state_defs.size()) { @@ -805,20 +805,20 @@ update_frame(int state) { // Now create new frame geometry. if (has_frame()) { - qpNodePath &root = get_state_def(state); + NodePath &root = get_state_def(state); _state_defs[state]._frame = _state_defs[state]._frame_style.generate_into(root, _frame); } } //////////////////////////////////////////////////////////////////// -// Function: qpPGItem::mark_frames_stale +// Function: PGItem::mark_frames_stale // Access: Private // Description: Marks all the frames in all states stale, so that // they will be regenerated the next time each state is // requested. //////////////////////////////////////////////////////////////////// -void qpPGItem:: +void PGItem:: mark_frames_stale() { StateDefs::iterator di; for (di = _state_defs.begin(); di != _state_defs.end(); ++di) { diff --git a/panda/src/pgui/qppgItem.h b/panda/src/pgui/pgItem.h similarity index 86% rename from panda/src/pgui/qppgItem.h rename to panda/src/pgui/pgItem.h index fbb084c87d..84dbec07a6 100644 --- a/panda/src/pgui/qppgItem.h +++ b/panda/src/pgui/pgItem.h @@ -1,4 +1,4 @@ -// Filename: qppgItem.h +// Filename: pgItem.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPGITEM_H -#define qpPGITEM_H +#ifndef PGITEM_H +#define PGITEM_H #include "pandabase.h" @@ -25,10 +25,10 @@ #include "pgFrameStyle.h" #include "pandaNode.h" -#include "qpnodePath.h" +#include "nodePath.h" #include "luse.h" #include "pointerTo.h" -#include "qptextNode.h" +#include "textNode.h" #include "pmap.h" @@ -37,7 +37,7 @@ class MouseWatcherParameter; class AudioSound; //////////////////////////////////////////////////////////////////// -// Class : qpPGItem +// Class : PGItem // Description : This is the base class for all the various kinds of // gui widget objects. // @@ -46,22 +46,22 @@ class AudioSound; // "state" subgraphs, one of which is rendered at any // given time according to its current state. // -// The qpPGItem node must be parented to the scene graph +// The PGItem node must be parented to the scene graph // somewhere beneath a PGTop node in order for this // behavior to work. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPGItem : public PandaNode { +class EXPCL_PANDA PGItem : public PandaNode { PUBLISHED: - qpPGItem(const string &name); - virtual ~qpPGItem(); + PGItem(const string &name); + virtual ~PGItem(); protected: - qpPGItem(const qpPGItem ©); + PGItem(const PGItem ©); virtual PandaNode *make_copy() const; virtual void xform(const LMatrix4f &mat); virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual BoundingVolume *recompute_internal_bound(); @@ -108,8 +108,8 @@ PUBLISHED: int get_num_state_defs() const; void clear_state_def(int state); bool has_state_def(int state) const; - qpNodePath &get_state_def(int state); - qpNodePath instance_to_state_def(int state, const qpNodePath &path); + NodePath &get_state_def(int state); + NodePath instance_to_state_def(int state, const NodePath &path); PGFrameStyle get_frame_style(int state); void set_frame_style(int state, const PGFrameStyle &style); @@ -144,10 +144,10 @@ PUBLISHED: bool has_sound(const string &event) const; #endif - static qpTextNode *get_text_node(); - INLINE static void set_text_node(qpTextNode *node); + static TextNode *get_text_node(); + INLINE static void set_text_node(TextNode *node); - INLINE static qpPGItem *get_focus_item(); + INLINE static PGItem *get_focus_item(); protected: void play_sound(const string &event); @@ -171,9 +171,9 @@ private: class StateDef { public: - qpNodePath _root; + NodePath _root; PGFrameStyle _frame_style; - qpNodePath _frame; + NodePath _frame; bool _frame_stale; }; typedef pvector StateDefs; @@ -184,10 +184,10 @@ private: Sounds _sounds; #endif - static PT(qpTextNode) _text_node; - static qpPGItem *_focus_item; + static PT(TextNode) _text_node; + static PGItem *_focus_item; - typedef pset BackgroundFocus; + typedef pset BackgroundFocus; static BackgroundFocus _background_focus; public: @@ -196,7 +196,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpPGItem", + register_type(_type_handle, "PGItem", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -208,6 +208,6 @@ private: static TypeHandle _type_handle; }; -#include "qppgItem.I" +#include "pgItem.I" #endif diff --git a/panda/src/pgui/pgMouseWatcherBackground.cxx b/panda/src/pgui/pgMouseWatcherBackground.cxx index 01aa6ca615..3c44ffeb0c 100644 --- a/panda/src/pgui/pgMouseWatcherBackground.cxx +++ b/panda/src/pgui/pgMouseWatcherBackground.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "pgMouseWatcherBackground.h" -#include "qppgItem.h" +#include "pgItem.h" TypeHandle PGMouseWatcherBackground::_type_handle; @@ -52,7 +52,7 @@ PGMouseWatcherBackground:: //////////////////////////////////////////////////////////////////// void PGMouseWatcherBackground:: press(const MouseWatcherParameter ¶m) { - qpPGItem::background_press(param); + PGItem::background_press(param); } //////////////////////////////////////////////////////////////////// @@ -64,7 +64,7 @@ press(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherBackground:: release(const MouseWatcherParameter ¶m) { - qpPGItem::background_release(param); + PGItem::background_release(param); } //////////////////////////////////////////////////////////////////// @@ -75,5 +75,5 @@ release(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherBackground:: keystroke(const MouseWatcherParameter ¶m) { - qpPGItem::background_keystroke(param); + PGItem::background_keystroke(param); } diff --git a/panda/src/pgui/pgMouseWatcherGroup.I b/panda/src/pgui/pgMouseWatcherGroup.I index c181ead307..42bfa71385 100644 --- a/panda/src/pgui/pgMouseWatcherGroup.I +++ b/panda/src/pgui/pgMouseWatcherGroup.I @@ -23,7 +23,7 @@ // Description: //////////////////////////////////////////////////////////////////// INLINE PGMouseWatcherGroup:: -PGMouseWatcherGroup(qpPGTop *top) : _qptop(top) { +PGMouseWatcherGroup(PGTop *top) : _top(top) { } //////////////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ PGMouseWatcherGroup(qpPGTop *top) : _qptop(top) { // object. //////////////////////////////////////////////////////////////////// INLINE void PGMouseWatcherGroup:: -clear_top(qpPGTop *top) { - nassertv(_qptop == top); - _qptop = (qpPGTop *)NULL; +clear_top(PGTop *top) { + nassertv(_top == top); + _top = (PGTop *)NULL; } diff --git a/panda/src/pgui/pgMouseWatcherGroup.cxx b/panda/src/pgui/pgMouseWatcherGroup.cxx index 1c923451ec..968df05fce 100644 --- a/panda/src/pgui/pgMouseWatcherGroup.cxx +++ b/panda/src/pgui/pgMouseWatcherGroup.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "pgMouseWatcherGroup.h" -#include "qppgTop.h" +#include "pgTop.h" TypeHandle PGMouseWatcherGroup::_type_handle; @@ -30,8 +30,8 @@ PGMouseWatcherGroup:: ~PGMouseWatcherGroup() { // When the MouseWatcherGroup destructs for whatever reason, the // PGTop object should lose its MouseWatcher. - if (_qptop != (qpPGTop *)NULL) { - _qptop->_watcher_group = (PGMouseWatcherGroup *)NULL; - _qptop->set_mouse_watcher((qpMouseWatcher *)NULL); + if (_top != (PGTop *)NULL) { + _top->_watcher_group = (PGMouseWatcherGroup *)NULL; + _top->set_mouse_watcher((MouseWatcher *)NULL); } } diff --git a/panda/src/pgui/pgMouseWatcherGroup.h b/panda/src/pgui/pgMouseWatcherGroup.h index 7e7b918d67..aab0e52e45 100644 --- a/panda/src/pgui/pgMouseWatcherGroup.h +++ b/panda/src/pgui/pgMouseWatcherGroup.h @@ -24,7 +24,7 @@ #include "mouseWatcherGroup.h" #include "pointerTo.h" -class qpPGTop; +class PGTop; //////////////////////////////////////////////////////////////////// // Class : PGMouseWatcherGroup @@ -36,13 +36,13 @@ class qpPGTop; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PGMouseWatcherGroup : public MouseWatcherGroup { public: - INLINE PGMouseWatcherGroup(qpPGTop *top); + INLINE PGMouseWatcherGroup(PGTop *top); virtual ~PGMouseWatcherGroup(); - INLINE void clear_top(qpPGTop *top); + INLINE void clear_top(PGTop *top); private: - qpPGTop *_qptop; + PGTop *_top; public: static TypeHandle get_class_type() { diff --git a/panda/src/pgui/pgMouseWatcherRegion.cxx b/panda/src/pgui/pgMouseWatcherRegion.cxx index b747ee2f65..84ad639bd6 100644 --- a/panda/src/pgui/pgMouseWatcherRegion.cxx +++ b/panda/src/pgui/pgMouseWatcherRegion.cxx @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// #include "pgMouseWatcherRegion.h" -#include "qppgItem.h" +#include "pgItem.h" #include "string_utils.h" @@ -30,11 +30,11 @@ TypeHandle PGMouseWatcherRegion::_type_handle; // Description: //////////////////////////////////////////////////////////////////// PGMouseWatcherRegion:: -PGMouseWatcherRegion(qpPGItem *item) : +PGMouseWatcherRegion(PGItem *item) : #ifndef CPPPARSER MouseWatcherRegion("pg" + format_string(_next_index++), 0, 0, 0, 0), #endif - _qpitem(item) + _item(item) { } @@ -59,8 +59,8 @@ PGMouseWatcherRegion:: //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: enter(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->enter(param); + if (_item != (PGItem *)NULL) { + _item->enter(param); } } @@ -75,8 +75,8 @@ enter(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: exit(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->exit(param); + if (_item != (PGItem *)NULL) { + _item->exit(param); } } @@ -92,8 +92,8 @@ exit(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: within(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->within(param); + if (_item != (PGItem *)NULL) { + _item->within(param); } } @@ -106,8 +106,8 @@ within(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: without(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->without(param); + if (_item != (PGItem *)NULL) { + _item->without(param); } } @@ -120,8 +120,8 @@ without(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: press(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->press(param, false); + if (_item != (PGItem *)NULL) { + _item->press(param, false); } } @@ -134,8 +134,8 @@ press(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: release(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->release(param, false); + if (_item != (PGItem *)NULL) { + _item->release(param, false); } } @@ -147,7 +147,7 @@ release(const MouseWatcherParameter ¶m) { //////////////////////////////////////////////////////////////////// void PGMouseWatcherRegion:: keystroke(const MouseWatcherParameter ¶m) { - if (_qpitem != (qpPGItem *)NULL) { - _qpitem->keystroke(param, false); + if (_item != (PGItem *)NULL) { + _item->keystroke(param, false); } } diff --git a/panda/src/pgui/pgMouseWatcherRegion.h b/panda/src/pgui/pgMouseWatcherRegion.h index 1d373eee1a..34961476d0 100644 --- a/panda/src/pgui/pgMouseWatcherRegion.h +++ b/panda/src/pgui/pgMouseWatcherRegion.h @@ -23,7 +23,7 @@ #include "mouseWatcherRegion.h" -class qpPGItem; +class PGItem; //////////////////////////////////////////////////////////////////// // Class : PGMouseWatcherRegion @@ -34,7 +34,7 @@ class qpPGItem; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PGMouseWatcherRegion : public MouseWatcherRegion { public: - PGMouseWatcherRegion(qpPGItem *item); + PGMouseWatcherRegion(PGItem *item); virtual ~PGMouseWatcherRegion(); virtual void enter(const MouseWatcherParameter ¶m); @@ -46,7 +46,7 @@ public: virtual void keystroke(const MouseWatcherParameter ¶m); private: - qpPGItem *_qpitem; + PGItem *_item; static int _next_index; public: @@ -66,7 +66,7 @@ public: private: static TypeHandle _type_handle; - friend class qpPGItem; + friend class PGItem; }; #include "pgMouseWatcherRegion.I" diff --git a/panda/src/pgui/qppgTop.I b/panda/src/pgui/pgTop.I similarity index 84% rename from panda/src/pgui/qppgTop.I rename to panda/src/pgui/pgTop.I index 47bf8a92f8..08bb5f694e 100644 --- a/panda/src/pgui/qppgTop.I +++ b/panda/src/pgui/pgTop.I @@ -1,4 +1,4 @@ -// Filename: qppgTop.I +// Filename: pgTop.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,37 +18,37 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::Copy Constructor +// Function: PGTop::Copy Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -INLINE qpPGTop:: -qpPGTop(const qpPGTop ©) : +INLINE PGTop:: +PGTop(const PGTop ©) : PandaNode(copy), _watcher(copy._watcher) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::get_mouse_watcher +// Function: PGTop::get_mouse_watcher // Access: Published -// Description: Returns the MouseWatcher pointer that the qpPGTop object +// Description: Returns the MouseWatcher pointer that the PGTop object // registers its PG items with, or NULL if the // MouseWatcher has not yet been set. //////////////////////////////////////////////////////////////////// -INLINE qpMouseWatcher *qpPGTop:: +INLINE MouseWatcher *PGTop:: get_mouse_watcher() const { return _watcher; } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::add_region +// Function: PGTop::add_region // Access: Public // Description: Adds the indicated region to the set of regions in // the group. Returns true if it was successfully // added, or false if it was already on the list. //////////////////////////////////////////////////////////////////// -INLINE bool qpPGTop:: +INLINE bool PGTop:: add_region(MouseWatcherRegion *region) { if (_watcher_group == (PGMouseWatcherGroup *)NULL) { return false; @@ -57,11 +57,11 @@ add_region(MouseWatcherRegion *region) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::clear_regions +// Function: PGTop::clear_regions // Access: Public // Description: Removes all the regions from the group. //////////////////////////////////////////////////////////////////// -INLINE void qpPGTop:: +INLINE void PGTop:: clear_regions() { if (_watcher_group == (PGMouseWatcherGroup *)NULL) { return; diff --git a/panda/src/pgui/qppgTop.cxx b/panda/src/pgui/pgTop.cxx similarity index 84% rename from panda/src/pgui/qppgTop.cxx rename to panda/src/pgui/pgTop.cxx index bd03f80e79..4c332edd3e 100644 --- a/panda/src/pgui/qppgTop.cxx +++ b/panda/src/pgui/pgTop.cxx @@ -1,4 +1,4 @@ -// Filename: qppgTop.cxx +// Filename: pgTop.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,27 +16,27 @@ // //////////////////////////////////////////////////////////////////// -#include "qppgTop.h" +#include "pgTop.h" #include "pgMouseWatcherGroup.h" #include "pgCullTraverser.h" #include "cullBinAttrib.h" #include "omniBoundingVolume.h" -TypeHandle qpPGTop::_type_handle; +TypeHandle PGTop::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::Constructor +// Function: PGTop::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpPGTop:: -qpPGTop(const string &name) : +PGTop:: +PGTop(const string &name) : PandaNode(name) { _watcher_group = (PGMouseWatcherGroup *)NULL; - // A qpPGTop node normally has an infinite bounding volume. Screw + // A PGTop node normally has an infinite bounding volume. Screw // culling. set_bound(OmniBoundingVolume()); set_final(true); @@ -51,30 +51,30 @@ qpPGTop(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::Destructor +// Function: PGTop::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpPGTop:: -~qpPGTop() { - set_mouse_watcher((qpMouseWatcher *)NULL); +PGTop:: +~PGTop() { + set_mouse_watcher((MouseWatcher *)NULL); } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::make_copy +// Function: PGTop::make_copy // Access: Protected, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpPGTop:: +PandaNode *PGTop:: make_copy() const { - return new qpPGTop(*this); + return new PGTop(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::has_cull_callback +// Function: PGTop::has_cull_callback // Access: Protected, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -82,13 +82,13 @@ make_copy() const { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpPGTop:: +bool PGTop:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::cull_callback +// Function: PGTop::cull_callback // Access: Protected, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -106,8 +106,8 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpPGTop:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { +bool PGTop:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { // Empty our set of regions in preparation for re-adding whichever // ones we encounter in the traversal that are current. clear_regions(); @@ -124,25 +124,25 @@ cull_callback(qpCullTraverser *trav, CullTraverserData &data) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGTop::set_mouse_watcher +// Function: PGTop::set_mouse_watcher // Access: Published -// Description: Sets the MouseWatcher pointer that the qpPGTop object +// Description: Sets the MouseWatcher pointer that the PGTop object // registers its PG items with. This must be set before // the PG items are active. //////////////////////////////////////////////////////////////////// -void qpPGTop:: -set_mouse_watcher(qpMouseWatcher *watcher) { +void PGTop:: +set_mouse_watcher(MouseWatcher *watcher) { if (_watcher_group != (PGMouseWatcherGroup *)NULL) { _watcher_group->clear_top(this); } - if (_watcher != (qpMouseWatcher *)NULL) { + if (_watcher != (MouseWatcher *)NULL) { _watcher->remove_group(_watcher_group); } _watcher = watcher; _watcher_group = (PGMouseWatcherGroup *)NULL; - if (_watcher != (qpMouseWatcher *)NULL) { + if (_watcher != (MouseWatcher *)NULL) { // We create a new PGMouseWatcherGroup, but we don't own the // reference count; the watcher will own this for us. _watcher_group = new PGMouseWatcherGroup(this); diff --git a/panda/src/pgui/qppgTop.h b/panda/src/pgui/pgTop.h similarity index 82% rename from panda/src/pgui/qppgTop.h rename to panda/src/pgui/pgTop.h index d1acfb9a2d..68a56c18b7 100644 --- a/panda/src/pgui/qppgTop.h +++ b/panda/src/pgui/pgTop.h @@ -1,4 +1,4 @@ -// Filename: qppgTop.h +// Filename: pgTop.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,15 +16,15 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPGTOP_H -#define qpPGTOP_H +#ifndef PGTOP_H +#define PGTOP_H #include "pandabase.h" #include "pgMouseWatcherGroup.h" #include "pandaNode.h" -#include "qpmouseWatcher.h" +#include "mouseWatcher.h" #include "pointerTo.h" class GraphicsStateGuardian; @@ -44,22 +44,22 @@ class PGMouseWatcherGroup; // depth-first, left-to-right order, appropriate for 2-d // objects. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPGTop : public PandaNode { +class EXPCL_PANDA PGTop : public PandaNode { PUBLISHED: - qpPGTop(const string &name); - virtual ~qpPGTop(); + PGTop(const string &name); + virtual ~PGTop(); protected: - INLINE qpPGTop(const qpPGTop ©); + INLINE PGTop(const PGTop ©); public: virtual PandaNode *make_copy() const; virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); PUBLISHED: - void set_mouse_watcher(qpMouseWatcher *watcher); - INLINE qpMouseWatcher *get_mouse_watcher() const; + void set_mouse_watcher(MouseWatcher *watcher); + INLINE MouseWatcher *get_mouse_watcher() const; public: // These methods duplicate the functionality of MouseWatcherGroup. @@ -67,7 +67,7 @@ public: INLINE void clear_regions(); private: - PT(qpMouseWatcher) _watcher; + PT(MouseWatcher) _watcher; PGMouseWatcherGroup *_watcher_group; public: @@ -76,7 +76,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpPGTop", + register_type(_type_handle, "PGTop", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -90,6 +90,6 @@ private: friend class PGMouseWatcherGroup; }; -#include "qppgTop.I" +#include "pgTop.I" #endif diff --git a/panda/src/pgui/qppgWaitBar.I b/panda/src/pgui/pgWaitBar.I similarity index 84% rename from panda/src/pgui/qppgWaitBar.I rename to panda/src/pgui/pgWaitBar.I index 0f35e81025..3d3b9e0809 100644 --- a/panda/src/pgui/qppgWaitBar.I +++ b/panda/src/pgui/pgWaitBar.I @@ -1,4 +1,4 @@ -// Filename: qppgWaitBar.I +// Filename: pgWaitBar.I // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,77 +18,77 @@ //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::set_range +// Function: PGWaitBar::set_range // Access: Published // Description: Sets the value at which the WaitBar indicates 100%. //////////////////////////////////////////////////////////////////// -INLINE void qpPGWaitBar:: +INLINE void PGWaitBar:: set_range(float range) { _range = range; _bar_state = -1; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::get_range +// Function: PGWaitBar::get_range // Access: Published // Description: Returns the value at which the WaitBar indicates 100%. //////////////////////////////////////////////////////////////////// -INLINE float qpPGWaitBar:: +INLINE float PGWaitBar:: get_range() const { return _range; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::set_value +// Function: PGWaitBar::set_value // Access: Published // Description: Sets the current value of the bar. This should range // between 0 and get_range(). //////////////////////////////////////////////////////////////////// -INLINE void qpPGWaitBar:: +INLINE void PGWaitBar:: set_value(float value) { _value = value; _bar_state = -1; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::get_value +// Function: PGWaitBar::get_value // Access: Published // Description: Returns the current value of the bar. //////////////////////////////////////////////////////////////////// -INLINE float qpPGWaitBar:: +INLINE float PGWaitBar:: get_value() const { return _value; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::get_percent +// Function: PGWaitBar::get_percent // Access: Published // Description: Returns the percentage complete. //////////////////////////////////////////////////////////////////// -INLINE float qpPGWaitBar:: +INLINE float PGWaitBar:: get_percent() const { return _value / _range * 100.0; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::set_bar_style +// Function: PGWaitBar::set_bar_style // Access: Published // Description: Sets the kind of frame that is drawn on top of the // WaitBar to represent the amount completed. //////////////////////////////////////////////////////////////////// -INLINE void qpPGWaitBar:: +INLINE void PGWaitBar:: set_bar_style(const PGFrameStyle &style) { _bar_style = style; _bar_state = -1; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::get_bar_style +// Function: PGWaitBar::get_bar_style // Access: Published // Description: Returns the kind of frame that is drawn on top of the // WaitBar to represent the amount completed. //////////////////////////////////////////////////////////////////// -INLINE PGFrameStyle qpPGWaitBar:: +INLINE PGFrameStyle PGWaitBar:: get_bar_style() const { return _bar_style; } diff --git a/panda/src/pgui/qppgWaitBar.cxx b/panda/src/pgui/pgWaitBar.cxx similarity index 84% rename from panda/src/pgui/qppgWaitBar.cxx rename to panda/src/pgui/pgWaitBar.cxx index d9b197f37f..9054adf694 100644 --- a/panda/src/pgui/qppgWaitBar.cxx +++ b/panda/src/pgui/pgWaitBar.cxx @@ -1,4 +1,4 @@ -// Filename: qppgWaitBar.cxx +// Filename: pgWaitBar.cxx // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,20 +16,20 @@ // //////////////////////////////////////////////////////////////////// -#include "qppgWaitBar.h" +#include "pgWaitBar.h" #include "pgMouseWatcherParameter.h" #include "throw_event.h" -TypeHandle qpPGWaitBar::_type_handle; +TypeHandle PGWaitBar::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::Constructor +// Function: PGWaitBar::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpPGWaitBar:: -qpPGWaitBar(const string &name) : qpPGItem(name) +PGWaitBar:: +PGWaitBar(const string &name) : PGItem(name) { _range = 100.0; _value = 0.0; @@ -37,22 +37,22 @@ qpPGWaitBar(const string &name) : qpPGItem(name) } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::Destructor +// Function: PGWaitBar::Destructor // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpPGWaitBar:: -~qpPGWaitBar() { +PGWaitBar:: +~PGWaitBar() { } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::Copy Constructor +// Function: PGWaitBar::Copy Constructor // Access: Protected // Description: //////////////////////////////////////////////////////////////////// -qpPGWaitBar:: -qpPGWaitBar(const qpPGWaitBar ©) : - qpPGItem(copy), +PGWaitBar:: +PGWaitBar(const PGWaitBar ©) : + PGItem(copy), _range(copy._range), _value(copy._value) { @@ -60,20 +60,20 @@ qpPGWaitBar(const qpPGWaitBar ©) : } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::make_copy +// Function: PGWaitBar::make_copy // Access: Public, Virtual // Description: Returns a newly-allocated Node that is a shallow copy // of this one. It will be a different Node pointer, // but its internal data may or may not be shared with // that of the original Node. //////////////////////////////////////////////////////////////////// -PandaNode *qpPGWaitBar:: +PandaNode *PGWaitBar:: make_copy() const { - return new qpPGWaitBar(*this); + return new PGWaitBar(*this); } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::has_cull_callback +// Function: PGWaitBar::has_cull_callback // Access: Protected, Virtual // Description: Should be overridden by derived classes to return // true if cull_callback() has been defined. Otherwise, @@ -81,13 +81,13 @@ make_copy() const { // need to be called for this node during the cull // traversal. //////////////////////////////////////////////////////////////////// -bool qpPGWaitBar:: +bool PGWaitBar:: has_cull_callback() const { return true; } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::cull_callback +// Function: PGWaitBar::cull_callback // Access: Protected, Virtual // Description: If has_cull_callback() returns true, this function // will be called during the cull traversal to perform @@ -105,19 +105,19 @@ has_cull_callback() const { // The return value is true if this node should be // visible, or false if it should be culled. //////////////////////////////////////////////////////////////////// -bool qpPGWaitBar:: -cull_callback(qpCullTraverser *trav, CullTraverserData &data) { +bool PGWaitBar:: +cull_callback(CullTraverser *trav, CullTraverserData &data) { update(); - return qpPGItem::cull_callback(trav, data); + return PGItem::cull_callback(trav, data); } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::setup +// Function: PGWaitBar::setup // Access: Public -// Description: Creates a qpPGWaitBar with the indicated dimensions, +// Description: Creates a PGWaitBar with the indicated dimensions, // with the indicated maximum range. //////////////////////////////////////////////////////////////////// -void qpPGWaitBar:: +void PGWaitBar:: setup(float width, float height, float range) { set_state(0); clear_state_def(0); @@ -137,12 +137,12 @@ setup(float width, float height, float range) { } //////////////////////////////////////////////////////////////////// -// Function: qpPGWaitBar::update +// Function: PGWaitBar::update // Access: Private // Description: Computes the appropriate size of the bar frame // according to the percentage completed. //////////////////////////////////////////////////////////////////// -void qpPGWaitBar:: +void PGWaitBar:: update() { int state = get_state(); @@ -157,7 +157,7 @@ update() { // Now create new bar geometry. if (_value != 0.0 && _range != 0.0) { - qpNodePath &root = get_state_def(state); + NodePath &root = get_state_def(state); nassertv(!root.is_empty()); PGFrameStyle style = get_frame_style(state); diff --git a/panda/src/pgui/qppgWaitBar.h b/panda/src/pgui/pgWaitBar.h similarity index 75% rename from panda/src/pgui/qppgWaitBar.h rename to panda/src/pgui/pgWaitBar.h index 32fcca60e4..646a6c6958 100644 --- a/panda/src/pgui/qppgWaitBar.h +++ b/panda/src/pgui/pgWaitBar.h @@ -1,4 +1,4 @@ -// Filename: qppgWaitBar.h +// Filename: pgWaitBar.h // Created by: drose (14Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,32 +16,32 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpPGWAITBAR_H -#define qpPGWAITBAR_H +#ifndef PGWAITBAR_H +#define PGWAITBAR_H #include "pandabase.h" -#include "qppgItem.h" +#include "pgItem.h" //////////////////////////////////////////////////////////////////// -// Class : qpPGWaitBar -// Description : This is a particular kind of qpPGItem that draws a +// Class : PGWaitBar +// Description : This is a particular kind of PGItem that draws a // little bar that fills from left to right to indicate // a slow process gradually completing, like a // traditional "wait, loading" bar. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpPGWaitBar : public qpPGItem { +class EXPCL_PANDA PGWaitBar : public PGItem { PUBLISHED: - qpPGWaitBar(const string &name = ""); - virtual ~qpPGWaitBar(); + PGWaitBar(const string &name = ""); + virtual ~PGWaitBar(); protected: - qpPGWaitBar(const qpPGWaitBar ©); + PGWaitBar(const PGWaitBar ©); public: virtual PandaNode *make_copy() const; virtual bool has_cull_callback() const; - virtual bool cull_callback(qpCullTraverser *trav, CullTraverserData &data); + virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); PUBLISHED: void setup(float width, float height, float range); @@ -63,16 +63,16 @@ private: float _range, _value; int _bar_state; PGFrameStyle _bar_style; - qpNodePath _bar; + NodePath _bar; public: static TypeHandle get_class_type() { return _type_handle; } static void init_type() { - qpPGItem::init_type(); - register_type(_type_handle, "qpPGWaitBar", - qpPGItem::get_class_type()); + PGItem::init_type(); + register_type(_type_handle, "PGWaitBar", + PGItem::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -83,6 +83,6 @@ private: static TypeHandle _type_handle; }; -#include "qppgWaitBar.I" +#include "pgWaitBar.I" #endif diff --git a/panda/src/pgui/pgui_composite1.cxx b/panda/src/pgui/pgui_composite1.cxx index c652d38ab9..b2e391f435 100644 --- a/panda/src/pgui/pgui_composite1.cxx +++ b/panda/src/pgui/pgui_composite1.cxx @@ -1,8 +1,8 @@ #include "config_pgui.cxx" -#include "qppgButton.cxx" +#include "pgButton.cxx" #include "pgCullTraverser.cxx" -#include "qppgEntry.cxx" +#include "pgEntry.cxx" #include "pgMouseWatcherGroup.cxx" #include "pgMouseWatcherParameter.cxx" diff --git a/panda/src/pgui/pgui_composite2.cxx b/panda/src/pgui/pgui_composite2.cxx index 421d15226b..a728997d8c 100644 --- a/panda/src/pgui/pgui_composite2.cxx +++ b/panda/src/pgui/pgui_composite2.cxx @@ -1,8 +1,8 @@ #include "pgFrameStyle.cxx" -#include "qppgItem.cxx" +#include "pgItem.cxx" #include "pgMouseWatcherBackground.cxx" #include "pgMouseWatcherRegion.cxx" -#include "qppgTop.cxx" -#include "qppgWaitBar.cxx" +#include "pgTop.cxx" +#include "pgWaitBar.cxx" diff --git a/panda/src/physics/baseIntegrator.cxx b/panda/src/physics/baseIntegrator.cxx index 56146e1635..6cdc421ed9 100644 --- a/panda/src/physics/baseIntegrator.cxx +++ b/panda/src/physics/baseIntegrator.cxx @@ -19,7 +19,7 @@ #include "baseIntegrator.h" #include "physicalNode.h" #include "forceNode.h" -#include "qpnodePath.h" +#include "nodePath.h" //////////////////////////////////////////////////////////////////// // Function : BaseIntegrator @@ -67,14 +67,14 @@ precompute_linear_matrices(Physical *physical, _precomputed_linear_matrices.clear(); _precomputed_linear_matrices.reserve(global_force_vec_size + local_force_vec_size); - qpNodePath physical_np(physical_node); + NodePath physical_np(physical_node); // tally the global xforms for (i = 0; i < global_force_vec_size; i++) { force_node = forces[i]->get_force_node(); nassertv(force_node != (ForceNode *) NULL); - qpNodePath force_np(force_node); + NodePath force_np(force_node); _precomputed_linear_matrices.push_back(physical_np.get_mat(force_node)); } @@ -86,7 +86,7 @@ precompute_linear_matrices(Physical *physical, force_node = force_vector[i]->get_force_node(); nassertv(force_node != (ForceNode *) NULL); - qpNodePath force_np(force_node); + NodePath force_np(force_node); _precomputed_linear_matrices.push_back(physical_np.get_mat(force_node)); } } @@ -119,14 +119,14 @@ precompute_angular_matrices(Physical *physical, _precomputed_angular_matrices.clear(); _precomputed_angular_matrices.reserve(global_force_vec_size + local_force_vec_size); - qpNodePath physical_np(physical_node); + NodePath physical_np(physical_node); // tally the global xforms for (i = 0; i < global_force_vec_size; i++) { force_node = forces[i]->get_force_node(); nassertv(force_node != (ForceNode *) NULL); - qpNodePath force_np(force_node); + NodePath force_np(force_node); _precomputed_angular_matrices.push_back(physical_np.get_mat(force_node)); } @@ -138,7 +138,7 @@ precompute_angular_matrices(Physical *physical, force_node = force_vector[i]->get_force_node(); nassertv(force_node != (ForceNode *) NULL); - qpNodePath force_np(force_node); + NodePath force_np(force_node); _precomputed_angular_matrices.push_back(physical_np.get_mat(force_node)); } } diff --git a/panda/src/pnmimage/pnmFileType.h b/panda/src/pnmimage/pnmFileType.h index 0c951caad0..b11dc398cd 100644 --- a/panda/src/pnmimage/pnmFileType.h +++ b/panda/src/pnmimage/pnmFileType.h @@ -19,15 +19,16 @@ #ifndef PNMFILETYPE_H #define PNMFILETYPE_H -#include +#include "pandabase.h" #include "pnmimage_base.h" -#include -#include +#include "typedObject.h" +#include "typedWritable.h" class PNMReader; class PNMWriter; +class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : PNMFileType diff --git a/panda/src/putil/Sources.pp b/panda/src/putil/Sources.pp index ed96b2c92f..9573d6f115 100644 --- a/panda/src/putil/Sources.pp +++ b/panda/src/putil/Sources.pp @@ -48,7 +48,7 @@ typedWritableReferenceCount.h updateSeq.I updateSeq.h \ vector_double.h vector_float.h vector_typedWritable.h \ vector_ushort.h vector_writable.h \ - writable.I writable.h writableConfigurable.h \ + writableConfigurable.h \ writableParam.I writableParam.h #define INCLUDED_SOURCES \ @@ -77,7 +77,7 @@ typedWritableReferenceCount.cxx updateSeq.cxx \ vector_double.cxx vector_float.cxx \ vector_typedWritable.cxx \ - vector_ushort.cxx vector_writable.cxx writable.cxx \ + vector_ushort.cxx vector_writable.cxx \ writableConfigurable.cxx writableParam.cxx #define INSTALL_HEADERS \ @@ -116,8 +116,8 @@ typedWritable.h typedWritableReferenceCount.I \ typedWritableReferenceCount.h updateSeq.I updateSeq.h \ vector_double.h vector_float.h vector_typedWritable.h \ - vector_ushort.h vector_writable.h writable.I \ - writable.h writableConfigurable.h writableParam.I \ + vector_ushort.h vector_writable.h \ + writableConfigurable.h writableParam.I \ writableParam.h #define IGATESCAN all diff --git a/panda/src/putil/bam.h b/panda/src/putil/bam.h index d7b1712d9b..ce57d7090f 100644 --- a/panda/src/putil/bam.h +++ b/panda/src/putil/bam.h @@ -16,31 +16,25 @@ // //////////////////////////////////////////////////////////////////// -//This file just holds the Magic Number, Major and Minor version -//numbers that are common to both BamWriter and BamReader. +// This file just holds the Magic Number, Major and Minor version +// numbers that are common to both BamWriter and BamReader. #ifndef _BAM_H #define _BAM_H -#include +#include "pandabase.h" -//The magic number for a BAM file and a carriage return and newline -//for detecting files damaged due to ASCII/Binary conversion +// The magic number for a BAM file. It includes a carriage return and +// newline character to help detect files damaged due to faulty +// ASCII/Binary conversion. static const string _bam_header = string("pbj\0\n\r", 6); -static const unsigned short _bam_major_ver = 3; +static const unsigned short _bam_major_ver = 4; // Bumped to major version 2 on 7/6/00 due to major changes in Character. // Bumped to major version 3 on 12/8/00 to change float64's to float32's. +// Bumped to major version 4 on 4/10/02 to store new scene graph. -static const unsigned short _bam_minor_ver = 7; -// Bumped to minor version 1 on 12/15/00 to add FFT-style channel -// compression. -// Bumped to minor version 2 on 2/15/01 to add ModelNode::_preserve_transform. -// Bumped to minor version 3 on 4/11/01 to support correctly ordered children. -// Bumped to minor version 4 on 12/11/01 to transpose quaternions. -// Bumped to minor version 5 on 12/13/01 to remove obsolete fields from Texture. -// Bumped to minor version 6 on 5/16/02 to add ImageBuffer::_filename. -// Bumped to minor version 7 on 5/19/02 to add CharacterJoint::_net_transform_nodes, etc. +static const unsigned short _bam_minor_ver = 0; #endif diff --git a/panda/src/putil/bamWriter.cxx b/panda/src/putil/bamWriter.cxx index 8d63fa11fe..44551e3eda 100644 --- a/panda/src/putil/bamWriter.cxx +++ b/panda/src/putil/bamWriter.cxx @@ -19,6 +19,7 @@ #include "pandabase.h" #include "notify.h" +#include "typedWritable.h" #include "config_util.h" #include "bam.h" #include "bamWriter.h" diff --git a/panda/src/putil/config_util.cxx b/panda/src/putil/config_util.cxx index 08f25ad1e8..6b7c09e8e6 100644 --- a/panda/src/putil/config_util.cxx +++ b/panda/src/putil/config_util.cxx @@ -28,7 +28,6 @@ #include "mouseButton.h" #include "factoryParam.h" #include "datagram.h" -#include "writable.h" #include "typedWritable.h" #include "typedWritableReferenceCount.h" #include "writableParam.h" @@ -54,7 +53,6 @@ ConfigureFn(config_util) { MouseButton::init_mouse_buttons(); FactoryParam::init_type(); Datagram::init_type(); - Writable::init_type(); TypedWritable::init_type(); WritableParam::init_type(); BamReaderParam::init_type(); diff --git a/panda/src/putil/putil_composite2.cxx b/panda/src/putil/putil_composite2.cxx index e6ae445fe0..d88413ed5d 100644 --- a/panda/src/putil/putil_composite2.cxx +++ b/panda/src/putil/putil_composite2.cxx @@ -17,7 +17,6 @@ #include "vector_typedWritable.cxx" #include "vector_ushort.cxx" #include "vector_writable.cxx" -#include "writable.cxx" #include "writableConfigurable.cxx" #include "writableParam.cxx" diff --git a/panda/src/putil/typedWritable.h b/panda/src/putil/typedWritable.h index 00e9d93b72..e011936f82 100644 --- a/panda/src/putil/typedWritable.h +++ b/panda/src/putil/typedWritable.h @@ -20,10 +20,12 @@ #define __TYPED_WRITABLE_ #include "typedObject.h" -#include "writable.h" #include "vector_typedWritable.h" class BamReader; +class BamWriter; +class Datagram; +class DatagramIterator; //////////////////////////////////////////////////////////////////// // Class : TypedWritable @@ -57,14 +59,9 @@ PUBLISHED: public: static void init_type() { - // We no longer derive from Writable, but we continue to record - // that derivation for now, just to keep bam files consistent - // until we move to bam version 4.0. TypedObject::init_type(); - Writable::init_type(); register_type(_type_handle, "TypedWritable", - TypedObject::get_class_type(), - Writable::get_class_type()); + TypedObject::get_class_type()); TypeRegistry::ptr()->record_alternate_name(_type_handle, "TypedWriteable"); } virtual TypeHandle get_type() const { diff --git a/panda/src/putil/writable.I b/panda/src/putil/writable.I deleted file mode 100644 index 20c41a7d31..0000000000 --- a/panda/src/putil/writable.I +++ /dev/null @@ -1,44 +0,0 @@ -// Filename: writable.I -// Created by: jason (19Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Function: Writable::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE Writable:: -Writable() { -} - -//////////////////////////////////////////////////////////////////// -// Function: Writable::Copy Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE Writable:: -Writable(const Writable &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: Writable::Copy Assignment Operator -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE void Writable:: -operator = (const Writable &) { -} diff --git a/panda/src/putil/writable.cxx b/panda/src/putil/writable.cxx deleted file mode 100644 index d012753c2e..0000000000 --- a/panda/src/putil/writable.cxx +++ /dev/null @@ -1,32 +0,0 @@ -// Filename: writable.cxx -// Created by: jason (19Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - - -#include "writable.h" - -TypeHandle Writable::_type_handle; -Writable* const Writable::Null = (Writable*)0L; - -//////////////////////////////////////////////////////////////////// -// Function: Writable::Destructor -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -Writable::~Writable() -{ -} diff --git a/panda/src/putil/writable.h b/panda/src/putil/writable.h deleted file mode 100644 index 4575526924..0000000000 --- a/panda/src/putil/writable.h +++ /dev/null @@ -1,99 +0,0 @@ -// Filename: writable.h -// Created by: jason (08Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - -#ifndef __WRITABLE_ -#define __WRITABLE_ - -#include "vector_writable.h" -#include "typedObject.h" - -class BamWriter; -class Datagram; -class DatagramIterator; -class FactoryParams; - -//////////////////////////////////////////////////////////////////// -// Class : Writable -// Description : This is an abstract class that all classes which -// need to write themselves in binary form to some -// media should inherit from -//////////////////////////////////////////////////////////////////// - -class EXPCL_PANDA Writable { -public: - static Writable* const Null; - - INLINE Writable(); - INLINE Writable(const Writable ©); - INLINE void operator = (const Writable ©); - - virtual ~Writable(); - - //The essential virtual function interface to define - //how any writable object, writes itself to a datagram - virtual void write_datagram(BamWriter *manager, Datagram &me) = 0; - - //This function is the interface through which BamReader is - //able to pass the completed object references into each - //object that requested them. - //In other words, if an object (when it is creating itself - //from a datagram) requests BamReader to generate an object - //that this object points to, this is the function that is - //eventually called by BamReader to complete those references. - //Return the number of pointers read. This is useful for when - //a parent reads in a variable number of pointers, so the child - //knows where to start reading from. - //virtual int complete_pointers(TypedWritable **p_list, - // BamReader *manager) {} - - - //When everything else is done, this is the function called - //by BamReader to perform any final actions needed for setting - //up the object - virtual void finalize(void) {} - -protected: - //This interface function is written here, as a suggestion - //for a function to write in any class that will have children - //that are also Writable. To encourage code re-use - - //virtual void fillin(DatagramIterator& scan, BamReader *manager); - -public: - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - register_type(_type_handle, "Writable"); - TypeRegistry::ptr()->record_alternate_name(_type_handle, "Writeable"); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type(void) { - init_type(); - return get_class_type(); - } - -private: - static TypeHandle _type_handle; -}; - -#include "writable.I" - -#endif diff --git a/panda/src/testbed/pgrid.cxx b/panda/src/testbed/pgrid.cxx index dd88addf4c..65ba0d7d8c 100644 --- a/panda/src/testbed/pgrid.cxx +++ b/panda/src/testbed/pgrid.cxx @@ -36,7 +36,7 @@ class GriddedFilename { public: Filename _filename; int _count; - qpNodePath _model; + NodePath _model; }; typedef pvector GriddedFilenames; @@ -227,7 +227,7 @@ load_gridded_models(WindowFramework *window, // separate from the scene graph. Also count up the total number of // models we'll be putting in the grid. int grid_count = 0; - qpNodePath models("models"); + NodePath models("models"); GriddedFilenames::iterator fi; for (fi = filenames.begin(); fi != filenames.end(); ++fi) { GriddedFilename &gf = (*fi); @@ -264,7 +264,7 @@ load_gridded_models(WindowFramework *window, int passnum = 0; bool loaded_any; - qpNodePath render = window->get_render(); + NodePath render = window->get_render(); do { loaded_any = false; @@ -276,7 +276,7 @@ load_gridded_models(WindowFramework *window, // position on the grid. string model_name = format_string(++model_count); - qpNodePath model = render.attach_new_node(model_name); + NodePath model = render.attach_new_node(model_name); gf._model.copy_to(model); gridded_file_info info; diff --git a/panda/src/text/Sources.pp b/panda/src/text/Sources.pp index 495f69894f..92afe46f0c 100644 --- a/panda/src/text/Sources.pp +++ b/panda/src/text/Sources.pp @@ -21,7 +21,7 @@ stringDecoder.I stringDecoder.h \ textFont.I textFont.h \ textGlyph.I textGlyph.h \ - qptextNode.I qptextNode.h qptextNode.cxx + textNode.I textNode.h textNode.cxx #define INCLUDED_SOURCES \ config_text.cxx \ @@ -43,7 +43,7 @@ stringDecoder.I stringDecoder.h \ textFont.I textFont.h \ textGlyph.I textGlyph.h \ - qptextNode.I qptextNode.h + textNode.I textNode.h #define IGATESCAN all diff --git a/panda/src/text/config_text.cxx b/panda/src/text/config_text.cxx index 689679fc5d..5b9889a52c 100644 --- a/panda/src/text/config_text.cxx +++ b/panda/src/text/config_text.cxx @@ -19,7 +19,7 @@ #include "config_text.h" #include "staticTextFont.h" #include "textFont.h" -#include "qptextNode.h" +#include "textNode.h" #include "dynamicTextFont.h" #include "dynamicTextPage.h" #include "geomTextGlyph.h" @@ -67,7 +67,7 @@ init_libtext() { StaticTextFont::init_type(); TextFont::init_type(); - qpTextNode::init_type(); + TextNode::init_type(); #ifdef HAVE_FREETYPE DynamicTextFont::init_type(); @@ -78,11 +78,11 @@ init_libtext() { string text_encoding = config_text.GetString("text-encoding", "iso8859"); if (text_encoding == "iso8859") { - qpTextNode::_default_encoding = qpTextNode::E_iso8859; + TextNode::_default_encoding = TextNode::E_iso8859; } else if (text_encoding == "utf8") { - qpTextNode::_default_encoding = qpTextNode::E_utf8; + TextNode::_default_encoding = TextNode::E_utf8; } else if (text_encoding == "unicode") { - qpTextNode::_default_encoding = qpTextNode::E_unicode; + TextNode::_default_encoding = TextNode::E_unicode; } else { text_cat.error() << "Invalid text-encoding: " << text_encoding << "\n"; diff --git a/panda/src/text/staticTextFont.cxx b/panda/src/text/staticTextFont.cxx index 35c0a2ab41..c9bd9c815a 100644 --- a/panda/src/text/staticTextFont.cxx +++ b/panda/src/text/staticTextFont.cxx @@ -21,7 +21,7 @@ #include "geom.h" #include "geomPoint.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "renderState.h" #include "dcast.h" @@ -37,7 +37,7 @@ TypeHandle StaticTextFont::_type_handle; StaticTextFont:: StaticTextFont(PandaNode *font_def) { nassertv(font_def != (PandaNode *)NULL); - _qpfont = font_def; + _font = font_def; _glyphs.clear(); find_characters(font_def, RenderState::make_empty()); @@ -191,7 +191,7 @@ find_character_gsets(PandaNode *root, Geom *&ch, GeomPoint *&dot, CPT(RenderState) next_net_state = net_state->compose(root->get_state()); if (root->is_geom_node()) { - qpGeomNode *geode = DCAST(qpGeomNode, root); + GeomNode *geode = DCAST(GeomNode, root); for (int i = 0; i < geode->get_num_geoms(); i++) { dDrawable *geom = geode->get_geom(i); diff --git a/panda/src/text/staticTextFont.h b/panda/src/text/staticTextFont.h index 347aa3b89e..cff6ec6523 100644 --- a/panda/src/text/staticTextFont.h +++ b/panda/src/text/staticTextFont.h @@ -60,7 +60,7 @@ private: typedef pmap Glyphs; Glyphs _glyphs; float _font_height; - PT(PandaNode) _qpfont; + PT(PandaNode) _font; public: static TypeHandle get_class_type() { diff --git a/panda/src/text/qptextNode.I b/panda/src/text/textNode.I similarity index 83% rename from panda/src/text/qptextNode.I rename to panda/src/text/textNode.I index bd6940df20..66bccf5547 100644 --- a/panda/src/text/qptextNode.I +++ b/panda/src/text/textNode.I @@ -1,4 +1,4 @@ -// Filename: qptextNode.I +// Filename: textNode.I // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,27 +18,27 @@ //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::freeze +// Function: TextNode::freeze // Access: Published -// Description: Freezes the qpTextNode in its current state, so that +// Description: Freezes the TextNode in its current state, so that // updates will not immediately be displayed. A series // of state changes may then be applied in succession, -// which will not force the qpTextNode to be recomputed. -// When thaw() is later called, the qpTextNode will update +// which will not force the TextNode to be recomputed. +// When thaw() is later called, the TextNode will update // itself exactly once to reflect all the state changes // that were made. // // freeze() and thaw() can nest. Strictly speaking, // each call to freeze() increments the current freeze // level, while each call to thaw() decrements it. The -// qpTextNode will only be updated when the current freeze +// TextNode will only be updated when the current freeze // level is zero. // // The return value of freeze() is the freeze level // *before* the freeze took place. This number should // match the return value of the matching thaw(). //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: freeze() { if (text_cat.is_debug()) { text_cat.debug() @@ -49,27 +49,27 @@ freeze() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_freeze_level +// Function: TextNode::get_freeze_level // Access: Published -// Description: Returns the current freeze level. The qpTextNode will +// Description: Returns the current freeze level. The TextNode will // not be updated visually unless this number is zero. // See freeze(). //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: get_freeze_level() const { return _freeze_level; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::thaw +// Function: TextNode::thaw // Access: Published // Description: Allows changes made since the last freeze() to be // visible. Strictly speaking, this actually decrements -// the freeze level, and updates the qpTextNode if the +// the freeze level, and updates the TextNode if the // level reaches zero. The return value is the new // freeze level after adjusting. See freeze(). //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: thaw() { if (text_cat.is_debug()) { text_cat.debug() @@ -87,11 +87,11 @@ thaw() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_font +// Function: TextNode::set_font // Access: Published // Description: Sets the font that will be used when making text. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_font(TextFont *font) { if (_font != font) { _font = font; @@ -100,17 +100,17 @@ set_font(TextFont *font) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_font +// Function: TextNode::get_font // Access: Published // Description: Returns the font currently in use. //////////////////////////////////////////////////////////////////// -INLINE TextFont *qpTextNode:: +INLINE TextFont *TextNode:: get_font() const { return _font; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_encoding +// Function: TextNode::set_encoding // Access: Published // Description: Specifies how the string set via set_text() is to be // interpreted. The default, E_iso8859, means a @@ -122,24 +122,24 @@ get_font() const { // This affects only future calls to set_text(); it does // not change text that was set previously. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: -set_encoding(qpTextNode::Encoding encoding) { +INLINE void TextNode:: +set_encoding(TextNode::Encoding encoding) { _encoding = encoding; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_encoding +// Function: TextNode::get_encoding // Access: Published // Description: Returns the encoding by which the string set via // set_text() is to be interpreted. See set_encoding(). //////////////////////////////////////////////////////////////////// -INLINE qpTextNode::Encoding qpTextNode:: +INLINE TextNode::Encoding TextNode:: get_encoding() const { return _encoding; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_expand_amp +// Function: TextNode::set_expand_amp // Access: Published // Description: Sets the state of the expand_amp flag. When this is // true, embedded ampersands in the text string are @@ -150,7 +150,7 @@ get_encoding() const { // This affects only future calls to set_text(); it does // not change text that was set previously. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_expand_amp(bool expand_amp) { if (expand_amp) { _flags |= F_expand_amp; @@ -160,33 +160,33 @@ set_expand_amp(bool expand_amp) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_expand_amp +// Function: TextNode::get_expand_amp // Access: Published // Description: Returns the state of the expand_amp flag. See // set_expand_amp(). //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: get_expand_amp() const { return (_flags & F_expand_amp) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_line_height +// Function: TextNode::get_line_height // Access: Published // Description: Returns the number of units high each line of text // is. This is based on the font. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_line_height() const { return (_font == (TextFont *)NULL) ? 0.0 : _font->get_line_height(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_slant +// Function: TextNode::set_slant // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_slant(float slant) { if (_slant != slant) { _slant = slant; @@ -195,22 +195,22 @@ set_slant(float slant) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_slant +// Function: TextNode::get_slant // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_slant() const { return _slant; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_align +// Function: TextNode::set_align // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: -set_align(qpTextNode::Alignment align_type) { +INLINE void TextNode:: +set_align(TextNode::Alignment align_type) { if (_align != align_type) { _align = align_type; rebuild(true); @@ -218,22 +218,22 @@ set_align(qpTextNode::Alignment align_type) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_align +// Function: TextNode::get_align // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE qpTextNode::Alignment qpTextNode:: +INLINE TextNode::Alignment TextNode:: get_align() const { return _align; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_wordwrap +// Function: TextNode::set_wordwrap // Access: Published -// Description: Sets the qpTextNode up to automatically wordwrap text +// Description: Sets the TextNode up to automatically wordwrap text // that exceeds the indicated width. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_wordwrap(float wordwrap) { if (!has_wordwrap() || _wordwrap_width != wordwrap) { _flags |= F_has_wordwrap; @@ -243,12 +243,12 @@ set_wordwrap(float wordwrap) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_wordwrap +// Function: TextNode::clear_wordwrap // Access: Published -// Description: Removes the wordwrap setting from the qpTextNode. Text +// Description: Removes the wordwrap setting from the TextNode. Text // will be as wide as it is. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_wordwrap() { if (has_wordwrap()) { _flags &= ~F_has_wordwrap; @@ -257,41 +257,41 @@ clear_wordwrap() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_wordwrap +// Function: TextNode::has_wordwrap // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_wordwrap() const { return (_flags & F_has_wordwrap) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_wordwrap +// Function: TextNode::get_wordwrap // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_wordwrap() const { return _wordwrap_width; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_text_color +// Function: TextNode::set_text_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_text_color(float r, float g, float b, float a) { set_text_color(Colorf(r, g, b, a)); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_text_color +// Function: TextNode::set_text_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_text_color(const Colorf &text_color) { if (!has_text_color() || _text_color != text_color) { _text_color = text_color; @@ -301,12 +301,12 @@ set_text_color(const Colorf &text_color) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_text_color +// Function: TextNode::clear_text_color // Access: Published // Description: Removes the text color specification; the text will // be colored whatever it was in the source font file. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_text_color() { if (has_text_color()) { _flags &= ~F_has_text_color; @@ -315,41 +315,41 @@ clear_text_color() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_text_color +// Function: TextNode::has_text_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_text_color() const { return (_flags & F_has_text_color) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_text_color +// Function: TextNode::get_text_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE Colorf qpTextNode:: +INLINE Colorf TextNode:: get_text_color() const { return _text_color; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_color +// Function: TextNode::set_frame_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_color(float r, float g, float b, float a) { set_frame_color(Colorf(r, g, b, a)); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_color +// Function: TextNode::set_frame_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_color(const Colorf &frame_color) { if (_frame_color != frame_color) { _frame_color = frame_color; @@ -358,21 +358,21 @@ set_frame_color(const Colorf &frame_color) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_frame_color +// Function: TextNode::get_frame_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE Colorf qpTextNode:: +INLINE Colorf TextNode:: get_frame_color() const { return _frame_color; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_border +// Function: TextNode::set_card_border // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_border(float size, float uv_portion) { if (!has_card_border() || _card_border_size != size || _card_border_uv_portion != uv_portion) { _flags |= F_has_card_border; @@ -383,11 +383,11 @@ set_card_border(float size, float uv_portion) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_card_border +// Function: TextNode::clear_card_border // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_card_border() { if (has_card_border()) { _flags &= ~F_has_card_border; @@ -396,51 +396,51 @@ clear_card_border() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_border_size +// Function: TextNode::get_card_border_size // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_card_border_size() const { return _card_border_size; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_border_uv_portion +// Function: TextNode::get_card_border_uv_portion // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_card_border_uv_portion() const { return _card_border_uv_portion; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_card_border +// Function: TextNode::has_card_border // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_card_border() const { return (_flags & F_has_card_border) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_color +// Function: TextNode::set_card_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_color(float r, float g, float b, float a) { set_card_color(Colorf(r, g, b, a)); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_color +// Function: TextNode::set_card_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_color(const Colorf &card_color) { if (_card_color != card_color) { _card_color = card_color; @@ -449,21 +449,21 @@ set_card_color(const Colorf &card_color) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_color +// Function: TextNode::get_card_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE Colorf qpTextNode:: +INLINE Colorf TextNode:: get_card_color() const { return _card_color; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_texture +// Function: TextNode::set_card_texture // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_texture(Texture *card_texture) { if (card_texture == (Texture *)NULL) { clear_card_texture(); @@ -477,11 +477,11 @@ set_card_texture(Texture *card_texture) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_card_texture +// Function: TextNode::clear_card_texture // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_card_texture() { if (has_card_texture()) { _flags &= ~F_has_card_texture; @@ -491,41 +491,41 @@ clear_card_texture() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_card_texture +// Function: TextNode::has_card_texture // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_card_texture() const { return (_flags & F_has_card_texture) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_texture +// Function: TextNode::get_card_texture // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE Texture *qpTextNode:: +INLINE Texture *TextNode:: get_card_texture() const { return _card_texture; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_shadow_color +// Function: TextNode::set_shadow_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_shadow_color(float r, float g, float b, float a) { set_shadow_color(Colorf(r, g, b, a)); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_shadow_color +// Function: TextNode::set_shadow_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_shadow_color(const Colorf &shadow_color) { if (_shadow_color != shadow_color) { _shadow_color = shadow_color; @@ -534,17 +534,17 @@ set_shadow_color(const Colorf &shadow_color) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_shadow_color +// Function: TextNode::get_shadow_color // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE Colorf qpTextNode:: +INLINE Colorf TextNode:: get_shadow_color() const { return _shadow_color; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_as_margin +// Function: TextNode::set_frame_as_margin // Access: Published // Description: Specifies that a border will be drawn around the text // when it is next created. The parameters are the @@ -552,7 +552,7 @@ get_shadow_color() const { // frame and the text in each dimension, and all should // generally be positive. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_as_margin(float left, float right, float bottom, float top) { _flags |= (F_has_frame | F_frame_as_margin); _frame_ul.set(left, top); @@ -561,7 +561,7 @@ set_frame_as_margin(float left, float right, float bottom, float top) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_actual +// Function: TextNode::set_frame_actual // Access: Published // Description: Similar to set_frame_as_margin, except the frame is // specified in actual coordinate units (relative to @@ -570,7 +570,7 @@ set_frame_as_margin(float left, float right, float bottom, float top) { // generally be negative, while the right and top // coordinates should generally be positive. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_actual(float left, float right, float bottom, float top) { _flags |= F_has_frame; _flags &= ~F_frame_as_margin; @@ -580,29 +580,29 @@ set_frame_actual(float left, float right, float bottom, float top) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_frame +// Function: TextNode::clear_frame // Access: Published // Description: Specifies that a border will not be drawn around the // text. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_frame() { _flags &= ~F_has_frame; rebuild(false); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_frame +// Function: TextNode::has_frame // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_frame() const { return (_flags & F_has_frame) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::is_frame_as_margin +// Function: TextNode::is_frame_as_margin // Access: Published // Description: If this is true, the frame was set via a call to // set_frame_as_margin(), and the dimension of the frame @@ -612,14 +612,14 @@ has_frame() const { // dimensions of the frame as returned by // get_frame_as_set() are relative to the text's origin. //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: is_frame_as_margin() const { nassertr(has_frame(), false); return (_flags & F_frame_as_margin) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_frame_as_set +// Function: TextNode::get_frame_as_set // Access: Published // Description: Returns the dimensions of the frame as set by // set_frame_as_margin() or set_frame_actual(). Use @@ -627,14 +627,14 @@ is_frame_as_margin() const { // values returned by this function. It is an error to // call this if has_frame() is false. //////////////////////////////////////////////////////////////////// -INLINE LVecBase4f qpTextNode:: +INLINE LVecBase4f TextNode:: get_frame_as_set() const { nassertr(has_frame(), LVecBase4f(0.0, 0.0, 0.0, 0.0)); return LVecBase4f(_frame_ul[0], _frame_lr[0], _frame_lr[1], _frame_ul[1]); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_frame_actual +// Function: TextNode::get_frame_actual // Access: Published // Description: Returns the actual dimensions of the frame around the // text. If the frame was set via set_frame_as_margin(), @@ -643,7 +643,7 @@ get_frame_as_set() const { // set_frame_actual(), this returns the values // actually set. //////////////////////////////////////////////////////////////////// -INLINE LVecBase4f qpTextNode:: +INLINE LVecBase4f TextNode:: get_frame_actual() const { nassertr(has_frame(), LVecBase4f(0.0, 0.0, 0.0, 0.0)); if (is_frame_as_margin()) { @@ -657,36 +657,36 @@ get_frame_actual() const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_line_width +// Function: TextNode::set_frame_line_width // Access: Published // Description: Specifies the thickness of the lines that will be // used to draw the frame. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_line_width(float frame_width) { _frame_width = frame_width; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_frame_line_width +// Function: TextNode::get_frame_line_width // Access: Published // Description: Returns the thickness of the lines that will be // used to draw the frame. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_frame_line_width() const { return _frame_width; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_frame_corners +// Function: TextNode::set_frame_corners // Access: Published // Description: Enables or disables the drawing of corners for the // frame. These are extra points drawn at each of the // four corners, to soften the ugly edges generated when // the line width is greater than one. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_frame_corners(bool corners) { if (corners) { _flags |= F_frame_corners; @@ -696,17 +696,17 @@ set_frame_corners(bool corners) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_frame_corners +// Function: TextNode::get_frame_corners // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: get_frame_corners() const { return (_flags & F_frame_corners) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_as_margin +// Function: TextNode::set_card_as_margin // Access: Published // Description: Specifies that a (possibly opaque or semitransparent) // card will be held behind the text when it is next @@ -715,7 +715,7 @@ get_frame_corners() const { // text in each dimension, and all should generally be // positive. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_as_margin(float left, float right, float bottom, float top) { _flags |= (F_has_card | F_card_as_margin); _card_ul.set(left, top); @@ -724,7 +724,7 @@ set_card_as_margin(float left, float right, float bottom, float top) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_card_actual +// Function: TextNode::set_card_actual // Access: Published // Description: Similar to set_card_as_margin, except the card is // specified in actual coordinate units (relative to @@ -733,7 +733,7 @@ set_card_as_margin(float left, float right, float bottom, float top) { // generally be negative, while the right and top // coordinates should generally be positive. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_card_actual(float left, float right, float bottom, float top) { _flags |= F_has_card; _flags &= ~F_card_as_margin; @@ -743,29 +743,29 @@ set_card_actual(float left, float right, float bottom, float top) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_card +// Function: TextNode::clear_card // Access: Published // Description: Specifies that a card will not be drawn behind the // text. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_card() { _flags &= ~F_has_card; rebuild(false); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_card +// Function: TextNode::has_card // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_card() const { return (_flags & F_has_card) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::is_card_as_margin +// Function: TextNode::is_card_as_margin // Access: Published // Description: If this is true, the card was set via a call to // set_card_as_margin(), and the dimension of the card @@ -775,14 +775,14 @@ has_card() const { // dimensions of the card as returned by // get_card_as_set() are relative to the text's origin. //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: is_card_as_margin() const { nassertr(has_card(), false); return (_flags & F_card_as_margin) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_as_set +// Function: TextNode::get_card_as_set // Access: Published // Description: Returns the dimensions of the card as set by // set_card_as_margin() or set_card_actual(). Use @@ -790,14 +790,14 @@ is_card_as_margin() const { // values returned by this function. It is an error to // call this if has_card() is false. //////////////////////////////////////////////////////////////////// -INLINE LVecBase4f qpTextNode:: +INLINE LVecBase4f TextNode:: get_card_as_set() const { nassertr(has_card(), LVecBase4f(0.0, 0.0, 0.0, 0.0)); return LVecBase4f(_card_ul[0], _card_lr[0], _card_lr[1], _card_ul[1]); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_actual +// Function: TextNode::get_card_actual // Access: Published // Description: Returns the actual dimensions of the card around the // text. If the card was set via set_card_as_margin(), @@ -810,7 +810,7 @@ get_card_as_set() const { // dimensions of the text itself, as if the card were // set with a margin of 0, 0, 0, 0. //////////////////////////////////////////////////////////////////// -INLINE LVecBase4f qpTextNode:: +INLINE LVecBase4f TextNode:: get_card_actual() const { if (!has_card()) { return LVecBase4f(get_left(), get_right(), get_bottom(), get_top()); @@ -826,7 +826,7 @@ get_card_actual() const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_card_transformed +// Function: TextNode::get_card_transformed // Access: Published // Description: Returns the actual card dimensions, transformed by // the matrix set by set_transform(). This returns the @@ -834,7 +834,7 @@ get_card_actual() const { // rest of the world. Also see get_upper_left_3d() and // get_lower_right_3d(). //////////////////////////////////////////////////////////////////// -INLINE LVecBase4f qpTextNode:: +INLINE LVecBase4f TextNode:: get_card_transformed() const { LVecBase4f card = get_card_actual(); LPoint3f ul = LPoint3f(card[0], 0.0, card[3]) * _transform; @@ -844,13 +844,13 @@ get_card_transformed() const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_shadow +// Function: TextNode::set_shadow // Access: Published // Description: Specifies that the text should be drawn with a // shadow, by creating a second copy of the text and // offsetting it slightly behind the first. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_shadow(float xoffset, float yoffset) { _flags |= F_has_shadow; _shadow_offset.set(xoffset, yoffset); @@ -858,44 +858,44 @@ set_shadow(float xoffset, float yoffset) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_shadow +// Function: TextNode::clear_shadow // Access: Published // Description: Specifies that a shadow will not be drawn behind the // text. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_shadow() { _flags &= ~F_has_shadow; rebuild(false); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_shadow +// Function: TextNode::has_shadow // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_shadow() const { return (_flags & F_has_shadow) != 0; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_shadow +// Function: TextNode::get_shadow // Access: Published // Description: Returns the offset of the shadow as set by // set_shadow(). It is an error to call this if // has_shadow() is false. //////////////////////////////////////////////////////////////////// -INLINE LVecBase2f qpTextNode:: +INLINE LVecBase2f TextNode:: get_shadow() const { nassertr(has_shadow(), LVecBase2f(0.0, 0.0)); return _shadow_offset; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_bin +// Function: TextNode::set_bin // Access: Published -// Description: Names the GeomBin that the qpTextNode geometry should +// Description: Names the GeomBin that the TextNode geometry should // be assigned to. If this is set, then a // GeomBinTransition will be created to explicitly place // each component in the named bin. @@ -905,49 +905,49 @@ get_shadow() const { // particularly useful if this names a GeomBinFixed, // e.g. "fixed". //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_bin(const string &bin) { _bin = bin; rebuild(false); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_bin +// Function: TextNode::clear_bin // Access: Published // Description: Removes the effect of a previous call to // set_bin(). Text will be drawn in whatever bin // it would like to be drawn in, with no explicit // ordering. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_bin() { _bin = string(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_bin +// Function: TextNode::has_bin // Access: Published // Description: Returns true if an explicit drawing bin has been // set via set_bin(), false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_bin() const { return !_bin.empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_bin +// Function: TextNode::get_bin // Access: Published // Description: Returns the drawing bin set with set_bin(), or empty // string if no bin has been set. //////////////////////////////////////////////////////////////////// -INLINE const string &qpTextNode:: +INLINE const string &TextNode:: get_bin() const { return _bin; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_draw_order +// Function: TextNode::set_draw_order // Access: Published // Description: Sets the drawing order of text created by the // TextMaker. This is actually the draw order of the @@ -961,7 +961,7 @@ get_bin() const { // The return value is the first unused draw_order // number, e.g. _draw_order + 3. //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: set_draw_order(int draw_order) { _draw_order = draw_order; rebuild(false); @@ -969,66 +969,66 @@ set_draw_order(int draw_order) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_draw_order +// Function: TextNode::get_draw_order // Access: Published // Description: Returns the drawing order set with set_draw_order(). //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: get_draw_order() const { return _draw_order; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_transform +// Function: TextNode::set_transform // Access: Published // Description: Sets an additional transform that is applied to the // entire text paragraph. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_transform(const LMatrix4f &transform) { _transform = transform; rebuild(true); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_transform +// Function: TextNode::get_transform // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE LMatrix4f qpTextNode:: +INLINE LMatrix4f TextNode:: get_transform() const { return _transform; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_coordinate_system +// Function: TextNode::set_coordinate_system // Access: Published // Description: Specifies the coordinate system in which the text // will be generated. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_coordinate_system(CoordinateSystem coordinate_system) { _coordinate_system = coordinate_system; rebuild(true); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_coordinate_system +// Function: TextNode::get_coordinate_system // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE CoordinateSystem qpTextNode:: +INLINE CoordinateSystem TextNode:: get_coordinate_system() const { return _coordinate_system; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_text +// Function: TextNode::set_text // Access: Published // Description: Changes the text that is displayed under the -// qpTextNode. +// TextNode. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_text(const string &text) { _text = text; _wtext = decode_text(text); @@ -1036,66 +1036,66 @@ set_text(const string &text) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::clear_text +// Function: TextNode::clear_text // Access: Published -// Description: Removes the text from the qpTextNode. +// Description: Removes the text from the TextNode. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: clear_text() { _text = ""; rebuild(true); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::has_text +// Function: TextNode::has_text // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE bool qpTextNode:: +INLINE bool TextNode:: has_text() const { return !_text.empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_text +// Function: TextNode::get_text // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE string qpTextNode:: +INLINE string TextNode:: get_text() const { return _text; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::calc_width +// Function: TextNode::calc_width // Access: Published // Description: Returns the width of a single character of the font, // or 0.0 if the character is not known. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: calc_width(int character) const { nassertr(_font != (TextFont *)NULL, 0.0); return _font->calc_width(character); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::calc_width +// Function: TextNode::calc_width // Access: Published // Description: Returns the width of a line of text of arbitrary // characters. The line should not include the newline // character. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: calc_width(const string &line) const { nassertr(_font != (TextFont *)NULL, 0.0); return _font->calc_width(decode_text(line)); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::rebuild +// Function: TextNode::rebuild // Access: Published -// Description: Updates the qpTextNode, if it is not frozen, or marks -// the qpTextNode as requiring an update if it is. If the +// Description: Updates the TextNode, if it is not frozen, or marks +// the TextNode as requiring an update if it is. If the // text is currently frozen, nothing will be done until // it is thawed, unless needs_measure is true, in which // case the text will be re-measured even if it is @@ -1106,7 +1106,7 @@ calc_width(const string &line) const { // not need to be called explicitly unless something // goes wrong. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: rebuild(bool needs_measure) { if (_freeze_level <= 0) { do_rebuild(); @@ -1120,7 +1120,7 @@ rebuild(bool needs_measure) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::measure +// Function: TextNode::measure // Access: Published // Description: Measures the extent of the text as it will be placed, // without actually placing it. Normally, this function @@ -1128,126 +1128,126 @@ rebuild(bool needs_measure) { // parameters changes. It should not need to be called // explicitly unless something goes wrong. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: measure() { do_measure(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_left +// Function: TextNode::get_left // Access: Published // Description: Returns the leftmost extent of the text in local 2-d // coordinates, unmodified by the set_transform() // matrix. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_left() const { return _ul2d[0]; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_right +// Function: TextNode::get_right // Access: Published // Description: Returns the rightmost extent of the text in local 2-d // coordinates, unmodified by the set_transform() // matrix. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_right() const { return _lr2d[0]; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_bottom +// Function: TextNode::get_bottom // Access: Published // Description: Returns the bottommost extent of the text in local // 2-d coordinates, unmodified by the set_transform() // matrix. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_bottom() const { return _lr2d[1]; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_top +// Function: TextNode::get_top // Access: Published // Description: Returns the topmost extent of the text in local 2-d // coordinates, unmodified by the set_transform() // matrix. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_top() const { return _ul2d[1]; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_height +// Function: TextNode::get_height // Access: Published // Description: Returns the net height of the text in local 2-d // coordinates. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_height() const { return get_top() - get_bottom(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_width +// Function: TextNode::get_width // Access: Published // Description: Returns the net width of the text in local 2-d // coordinates. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: get_width() const { return get_right() - get_left(); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_upper_left_3d +// Function: TextNode::get_upper_left_3d // Access: Published // Description: Returns the upper-left extent of the text object, // after it has been transformed into 3-d space by // applying the set_transform() matrix. //////////////////////////////////////////////////////////////////// -INLINE LPoint3f qpTextNode:: +INLINE LPoint3f TextNode:: get_upper_left_3d() const { return _ul3d; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_lower_right_3d +// Function: TextNode::get_lower_right_3d // Access: Published // Description: Returns the lower-right extent of the text object, // after it has been transformed into 3-d space by // applying the set_transform() matrix. //////////////////////////////////////////////////////////////////// -INLINE LPoint3f qpTextNode:: +INLINE LPoint3f TextNode:: get_lower_right_3d() const { return _lr3d; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_num_rows +// Function: TextNode::get_num_rows // Access: Published // Description: Returns the number of rows of text that were // generated. This counts word-wrapped rows as well as // rows generated due to embedded newlines. //////////////////////////////////////////////////////////////////// -INLINE int qpTextNode:: +INLINE int TextNode:: get_num_rows() const { return _num_rows; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::set_wtext +// Function: TextNode::set_wtext // Access: Public // Description: Changes the text that is displayed under the -// qpTextNode, with a wide text. This automatically sets +// TextNode, with a wide text. This automatically sets // the string reported by get_text() to the 8-bit // encoded version of the same string. //////////////////////////////////////////////////////////////////// -INLINE void qpTextNode:: +INLINE void TextNode:: set_wtext(const wstring &wtext) { _wtext = wtext; _text = encode_wtext(wtext); @@ -1255,31 +1255,31 @@ set_wtext(const wstring &wtext) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::get_wtext +// Function: TextNode::get_wtext // Access: Public -// Description: Returns the text associated with the qpTextNode, as a +// Description: Returns the text associated with the TextNode, as a // wide-character string. //////////////////////////////////////////////////////////////////// -INLINE const wstring &qpTextNode:: +INLINE const wstring &TextNode:: get_wtext() const { return _wtext; } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::calc_width +// Function: TextNode::calc_width // Access: Published // Description: Returns the width of a line of text of arbitrary // characters. The line should not include the newline // character. //////////////////////////////////////////////////////////////////// -INLINE float qpTextNode:: +INLINE float TextNode:: calc_width(const wstring &line) const { nassertr(_font != (TextFont *)NULL, 0.0); return _font->calc_width(line); } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::wordwrap_to +// Function: TextNode::wordwrap_to // Access: Published // Description: Inserts newlines into the given text at the // appropriate places in order to make each line be the @@ -1287,7 +1287,7 @@ calc_width(const wstring &line) const { // wordwrap_width (and does not break any words, if // possible). Returns the new string. //////////////////////////////////////////////////////////////////// -INLINE wstring qpTextNode:: +INLINE wstring TextNode:: wordwrap_to(const wstring &wtext, float wordwrap_width, bool preserve_trailing_whitespace) const { nassertr(_font != (TextFont *)NULL, wtext); diff --git a/panda/src/text/qptextNode.cxx b/panda/src/text/textNode.cxx similarity index 94% rename from panda/src/text/qptextNode.cxx rename to panda/src/text/textNode.cxx index 96e3285f97..ca261860a9 100644 --- a/panda/src/text/qptextNode.cxx +++ b/panda/src/text/textNode.cxx @@ -1,4 +1,4 @@ -// Filename: qptextNode.cxx +// Filename: textNode.cxx // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qptextNode.h" +#include "textNode.h" #include "textGlyph.h" #include "stringDecoder.h" #include "config_text.h" @@ -26,30 +26,30 @@ #include "geomTristrip.h" #include "geomLinestrip.h" #include "geomPoint.h" -#include "qpgeomNode.h" +#include "geomNode.h" #include "notify.h" #include "transformState.h" #include "colorAttrib.h" #include "cullBinAttrib.h" #include "textureAttrib.h" #include "transparencyAttrib.h" -#include "qpsceneGraphReducer.h" +#include "sceneGraphReducer.h" #include "indent.h" #include #include -TypeHandle qpTextNode::_type_handle; +TypeHandle TextNode::_type_handle; -qpTextNode::Encoding qpTextNode::_default_encoding; +TextNode::Encoding TextNode::_default_encoding; //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::Constructor +// Function: TextNode::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpTextNode:: -qpTextNode(const string &name) : PandaNode(name) { +TextNode:: +TextNode(const string &name) : PandaNode(name) { _encoding = _default_encoding; _slant = 0.0f; @@ -86,16 +86,16 @@ qpTextNode(const string &name) : PandaNode(name) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::Destructor +// Function: TextNode::Destructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpTextNode:: -~qpTextNode() { +TextNode:: +~TextNode() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::wordwrap_to +// Function: TextNode::wordwrap_to // Access: Published // Description: Inserts newlines into the given text at the // appropriate places in order to make each line be the @@ -103,7 +103,7 @@ qpTextNode:: // wordwrap_width (and does not break any words, if // possible). Returns the new string. //////////////////////////////////////////////////////////////////// -string qpTextNode:: +string TextNode:: wordwrap_to(const string &text, float wordwrap_width, bool preserve_trailing_whitespace) const { nassertr(_font != (TextFont *)NULL, text); @@ -115,14 +115,14 @@ wordwrap_to(const string &text, float wordwrap_width, //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::write +// Function: TextNode::write // Access: Published, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpTextNode:: +void TextNode:: write(ostream &out, int indent_level) const { indent(out, indent_level) - << "qpTextNode " << get_name() << "\n"; + << "TextNode " << get_name() << "\n"; if (_font != (TextFont *)NULL) { indent(out, indent_level + 2) << "with font " << _font->get_name() << "\n"; @@ -217,13 +217,13 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::generate +// Function: TextNode::generate // Access: Published // Description: Generates the text, according to the parameters -// indicated within the qpTextNode, and returns a Node +// indicated within the TextNode, and returns a Node // that may be parented within the tree to represent it. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpTextNode:: +PT(PandaNode) TextNode:: generate() { if (text_cat.is_debug()) { text_cat.debug() @@ -363,7 +363,7 @@ generate() { // applying them to the vertices. if (text_flatten) { - qpSceneGraphReducer gr; + SceneGraphReducer gr; gr.apply_attribs(root); gr.flatten(root, true); } @@ -372,13 +372,13 @@ generate() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::encode_wchar +// Function: TextNode::encode_wchar // Access: Public // Description: Encodes a single wide char into a one-, two-, or // three-byte string, according to the current encoding // system in effect. //////////////////////////////////////////////////////////////////// -string qpTextNode:: +string TextNode:: encode_wchar(wchar_t ch) const { switch (_encoding) { case E_iso8859: @@ -412,12 +412,12 @@ encode_wchar(wchar_t ch) const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::encode_wtext +// Function: TextNode::encode_wtext // Access: Public // Description: Encodes a wide-text string into a single-char string, // accoding to the current encoding. //////////////////////////////////////////////////////////////////// -string qpTextNode:: +string TextNode:: encode_wtext(const wstring &wtext) const { string result; @@ -429,12 +429,12 @@ encode_wtext(const wstring &wtext) const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::decode_text +// Function: TextNode::decode_text // Access: Public // Description: Returns the given wstring decoded to a single-byte // string, via the current encoding system. //////////////////////////////////////////////////////////////////// -wstring qpTextNode:: +wstring TextNode:: decode_text(const string &text) const { switch (_encoding) { case E_utf8: @@ -459,13 +459,13 @@ decode_text(const string &text) const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::decode_text_impl +// Function: TextNode::decode_text_impl // Access: Private // Description: Decodes the eight-bit stream from the indicated // decoder, storing the decoded unicode characters in // _wtext. //////////////////////////////////////////////////////////////////// -wstring qpTextNode:: +wstring TextNode:: decode_text_impl(StringDecoder &decoder) const { wstring result; bool expand_amp = get_expand_amp(); @@ -485,7 +485,7 @@ decode_text_impl(StringDecoder &decoder) const { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::expand_amp_sequence +// Function: TextNode::expand_amp_sequence // Access: Private // Description: Given that we have just read an ampersand from the // StringDecoder, and that we have expand_amp in effect @@ -493,7 +493,7 @@ decode_text_impl(StringDecoder &decoder) const { // that this ampersand begins into a single unicode // character, do the expansion and return the character. //////////////////////////////////////////////////////////////////// -int qpTextNode:: +int TextNode:: expand_amp_sequence(StringDecoder &decoder) const { int result = 0; @@ -575,12 +575,12 @@ expand_amp_sequence(StringDecoder &decoder) const { //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::do_rebuild +// Function: TextNode::do_rebuild // Access: Private -// Description: Removes any existing children of the qpTextNode, and +// Description: Removes any existing children of the TextNode, and // adds the newly generated text instead. //////////////////////////////////////////////////////////////////// -void qpTextNode:: +void TextNode:: do_rebuild() { _needs_rebuild = false; @@ -603,13 +603,13 @@ do_rebuild() { //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::do_measure +// Function: TextNode::do_measure // Access: Private // Description: Can be called in lieu of do_rebuild() to measure the // text and set up the bounding boxes properly without // actually assembling it. //////////////////////////////////////////////////////////////////// -void qpTextNode:: +void TextNode:: do_measure() { _ul2d.set(0.0f, 0.0f); _lr2d.set(0.0f, 0.0f); @@ -643,7 +643,7 @@ do_measure() { #ifndef CPPPARSER // interrogate has a bit of trouble with wstring. //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::assemble_row +// Function: TextNode::assemble_row // Access: Private // Description: Assembles the letters in the source string, up until // the first newline or the end of the string into a @@ -651,7 +651,7 @@ do_measure() { // the length of the row. The source pointer is moved // to the terminating character. //////////////////////////////////////////////////////////////////// -float qpTextNode:: +float TextNode:: assemble_row(wstring::iterator &si, const wstring::iterator &send, PandaNode *dest) { nassertr(_font != (TextFont *)NULL, 0.0f); @@ -690,7 +690,7 @@ assemble_row(wstring::iterator &si, const wstring::iterator &send, mat.set_row(3, LVector3f(xpos, 0.0f, 0.0f)); string ch(1, (char)character); - PT(qpGeomNode) geode = new qpGeomNode(ch); + PT(GeomNode) geode = new GeomNode(ch); geode->add_geom(char_geom, state); dest->add_child(geode); geode->set_transform(TransformState::make_mat(mat)); @@ -706,13 +706,13 @@ assemble_row(wstring::iterator &si, const wstring::iterator &send, } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::assemble_text +// Function: TextNode::assemble_text // Access: Private // Description: Constructs a hierarchy of nodes that contain the // geometry representing the indicated source text, and // returns it. Also sets the ul, lr corners. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpTextNode:: +PT(PandaNode) TextNode:: assemble_text(wstring::iterator si, const wstring::iterator &send, LVector2f &ul, LVector2f &lr, int &num_rows) { nassertr(_font != (TextFont *)NULL, (PandaNode *)NULL); @@ -777,13 +777,13 @@ assemble_text(wstring::iterator si, const wstring::iterator &send, } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::measure_row +// Function: TextNode::measure_row // Access: Private // Description: Returns the length of the row in units, as it would // be if it were assembled, without actually assembling // it. //////////////////////////////////////////////////////////////////// -float qpTextNode:: +float TextNode:: measure_row(wstring::iterator &si, const wstring::iterator &send) { float xpos = 0.0f; while (si != send && *si != '\n') { @@ -809,12 +809,12 @@ measure_row(wstring::iterator &si, const wstring::iterator &send) { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::measure_text +// Function: TextNode::measure_text // Access: Private // Description: Sets the ul, lr corners to fit the text, without // actually assembling it. //////////////////////////////////////////////////////////////////// -void qpTextNode:: +void TextNode:: measure_text(wstring::iterator si, const wstring::iterator &send, LVector2f &ul, LVector2f &lr, int &num_rows) { nassertv(_font != (TextFont *)NULL); @@ -853,13 +853,13 @@ measure_text(wstring::iterator si, const wstring::iterator &send, #endif // CPPPARSER //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::make_frame +// Function: TextNode::make_frame // Access: Private // Description: Creates a frame around the text. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpTextNode:: +PT(PandaNode) TextNode:: make_frame() { - PT(qpGeomNode) frame_geode = new qpGeomNode("frame"); + PT(GeomNode) frame_geode = new GeomNode("frame"); LVector4f dimensions = get_frame_actual(); float left = dimensions[0]; @@ -897,13 +897,13 @@ make_frame() { } //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::make_card +// Function: TextNode::make_card // Access: Private // Description: Creates a card behind the text. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpTextNode:: +PT(PandaNode) TextNode:: make_card() { - PT(qpGeomNode) card_geode = new qpGeomNode("card"); + PT(GeomNode) card_geode = new GeomNode("card"); LVector4f dimensions = get_card_actual(); float left = dimensions[0]; @@ -943,14 +943,14 @@ make_card() { //////////////////////////////////////////////////////////////////// -// Function: qpTextNode::make_card_with_border +// Function: TextNode::make_card_with_border // Access: Private // Description: Creates a card behind the text with a specified border // for button edge or what have you. //////////////////////////////////////////////////////////////////// -PT(PandaNode) qpTextNode:: +PT(PandaNode) TextNode:: make_card_with_border() { - PT(qpGeomNode) card_geode = new qpGeomNode("card"); + PT(GeomNode) card_geode = new GeomNode("card"); LVector4f dimensions = get_card_actual(); float left = dimensions[0]; diff --git a/panda/src/text/qptextNode.h b/panda/src/text/textNode.h similarity index 97% rename from panda/src/text/qptextNode.h rename to panda/src/text/textNode.h index 8dc5a9edbb..b0c4f78038 100644 --- a/panda/src/text/qptextNode.h +++ b/panda/src/text/textNode.h @@ -1,4 +1,4 @@ -// Filename: qptextNode.h +// Filename: textNode.h // Created by: drose (13Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpTEXTNODE_H -#define qpTEXTNODE_H +#ifndef TEXTNODE_H +#define TEXTNODE_H #include "pandabase.h" @@ -55,10 +55,10 @@ class StringDecoder; // wherever you like. Each time you call generate() a // new node is returned. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpTextNode : public PandaNode { +class EXPCL_PANDA TextNode : public PandaNode { PUBLISHED: - qpTextNode(const string &name); - ~qpTextNode(); + TextNode(const string &name); + ~TextNode(); enum Alignment { A_left, @@ -298,7 +298,7 @@ public: } static void init_type() { PandaNode::init_type(); - register_type(_type_handle, "qpTextNode", + register_type(_type_handle, "TextNode", PandaNode::get_class_type()); } virtual TypeHandle get_type() const { @@ -310,6 +310,6 @@ private: static TypeHandle _type_handle; }; -#include "qptextNode.I" +#include "textNode.I" #endif diff --git a/panda/src/tform/Sources.pp b/panda/src/tform/Sources.pp index 242d77cbc0..d5382a3c48 100644 --- a/panda/src/tform/Sources.pp +++ b/panda/src/tform/Sources.pp @@ -10,35 +10,35 @@ #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx #define SOURCES \ - qpbuttonThrower.h \ + buttonThrower.h \ config_tform.h \ - qpdriveInterface.I qpdriveInterface.h \ - qpmouseWatcher.I qpmouseWatcher.h \ + driveInterface.I driveInterface.h \ + mouseWatcher.I mouseWatcher.h \ mouseWatcherGroup.h \ mouseWatcherParameter.I mouseWatcherParameter.h \ mouseWatcherRegion.I mouseWatcherRegion.h \ - qptrackball.h \ - qptransform2sg.h + trackball.h \ + transform2sg.h #define INCLUDED_SOURCES \ - qpbuttonThrower.cxx \ + buttonThrower.cxx \ config_tform.cxx \ - qpdriveInterface.cxx \ - qpmouseWatcher.cxx \ + driveInterface.cxx \ + mouseWatcher.cxx \ mouseWatcherGroup.cxx \ mouseWatcherParameter.cxx mouseWatcherRegion.cxx \ - qptrackball.cxx \ - qptransform2sg.cxx + trackball.cxx \ + transform2sg.cxx #define INSTALL_HEADERS \ - qpbuttonThrower.h \ - qpdriveInterface.I qpdriveInterface.h \ - qpmouseWatcher.I qpmouseWatcher.h \ + buttonThrower.h \ + driveInterface.I driveInterface.h \ + mouseWatcher.I mouseWatcher.h \ mouseWatcherGroup.h \ mouseWatcherParameter.I mouseWatcherParameter.h \ mouseWatcherRegion.I mouseWatcherRegion.h \ - qptrackball.h \ - qptransform2sg.h + trackball.h \ + transform2sg.h #define IGATESCAN all diff --git a/panda/src/tform/qpbuttonThrower.cxx b/panda/src/tform/buttonThrower.cxx similarity index 84% rename from panda/src/tform/qpbuttonThrower.cxx rename to panda/src/tform/buttonThrower.cxx index dd3b97ed7f..7576f5d9ff 100644 --- a/panda/src/tform/qpbuttonThrower.cxx +++ b/panda/src/tform/buttonThrower.cxx @@ -1,4 +1,4 @@ -// Filename: qpbuttonThrower.cxx +// Filename: buttonThrower.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qpbuttonThrower.h" +#include "buttonThrower.h" #include "buttonEvent.h" #include "buttonEventList.h" @@ -25,17 +25,17 @@ #include "indent.h" #include "dcast.h" -TypeHandle qpButtonThrower::_type_handle; +TypeHandle ButtonThrower::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::Constructor +// Function: ButtonThrower::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpButtonThrower:: -qpButtonThrower(const string &name) : - qpDataNode(name) +ButtonThrower:: +ButtonThrower(const string &name) : + DataNode(name) { _button_events_input = define_input("button_events", ButtonEventList::get_class_type()); _button_events_output = define_output("button_events", ButtonEventList::get_class_type()); @@ -46,74 +46,74 @@ qpButtonThrower(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::Destructor +// Function: ButtonThrower::Destructor // Access: Published, Virtual // Description: //////////////////////////////////////////////////////////////////// -qpButtonThrower:: -~qpButtonThrower() { +ButtonThrower:: +~ButtonThrower() { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::set_prefix +// Function: ButtonThrower::set_prefix // Access: Published // Description: Sets the prefix which is prepended to all event names // thrown by this object. //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: set_prefix(const string &prefix) { _prefix = prefix; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::has_prefix +// Function: ButtonThrower::has_prefix // Access: Published -// Description: Returns true if the qpButtonThrower has a prefix set, +// Description: Returns true if the ButtonThrower has a prefix set, // false otherwise. //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: has_prefix() const { return !_prefix.empty(); } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::get_prefix +// Function: ButtonThrower::get_prefix // Access: Published // Description: Returns the prefix that has been set on this -// qpButtonThrower. See set_prefix(). +// ButtonThrower. See set_prefix(). //////////////////////////////////////////////////////////////////// -string qpButtonThrower:: +string ButtonThrower:: get_prefix() const { return _prefix; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::get_modifier_buttons +// Function: ButtonThrower::get_modifier_buttons // Access: Published // Description: Returns the set of ModifierButtons that the -// qpButtonThrower will consider important enough to +// ButtonThrower will consider important enough to // prepend the event name with. Normally, this set will -// be empty, and the qpButtonThrower will therefore ignore +// be empty, and the ButtonThrower will therefore ignore // all ModifierButtons attached to the key events, but // if one or more buttons have been added to this set, // and those modifier buttons are set on the button // event, then the event name will be prepended with the // names of the modifier buttons. //////////////////////////////////////////////////////////////////// -const ModifierButtons &qpButtonThrower:: +const ModifierButtons &ButtonThrower:: get_modifier_buttons() const { return _mods; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::set_modifier_buttons +// Function: ButtonThrower::set_modifier_buttons // Access: Published // Description: Changes the set of ModifierButtons that the -// qpButtonThrower will consider important enough to +// ButtonThrower will consider important enough to // prepend the event name with. Normally, this set will -// be empty, and the qpButtonThrower will therefore ignore +// be empty, and the ButtonThrower will therefore ignore // all ModifierButtons attached to the key events, but // if one or more buttons have been added to this set, // then the event name will be prepended with the names @@ -125,59 +125,59 @@ get_modifier_buttons() const { // set_modifier_buttons(). This way the current state // of the modifier buttons will not be lost. //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: set_modifier_buttons(const ModifierButtons &mods) { _mods = mods; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::set_throw_buttons_active +// Function: ButtonThrower::set_throw_buttons_active // Access: Published // Description: Sets the flag that indicates whether the -// qpButtonThrower will only process events for the +// ButtonThrower will only process events for the // explicitly named buttons or not. Normally this is // false, meaning all buttons are processed; set it true // to indicate that only some buttons should be // processed. See add_throw_button(). //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: set_throw_buttons_active(bool flag) { _throw_buttons_active = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::get_throw_buttons_active +// Function: ButtonThrower::get_throw_buttons_active // Access: Published // Description: Returns the flag that indicates whether the -// qpButtonThrower will only process events for the +// ButtonThrower will only process events for the // explicitly named buttons or not. See // set_throw_buttons_active(). //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: get_throw_buttons_active() const { return _throw_buttons_active; } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::add_throw_button +// Function: ButtonThrower::add_throw_button // Access: Published // Description: Adds a new button to the set of buttons that the -// qpButtonThrower explicitly processes. +// ButtonThrower explicitly processes. // // If set_throw_buttons_active is false (which is the -// default), the qpButtonThrower will process all buttons. -// Otherwise, the qpButtonThrower will only process events +// default), the ButtonThrower will process all buttons. +// Otherwise, the ButtonThrower will only process events // for the button(s) explicitly named by this function; // buttons not on the list will be ignored by this // object and passed on downstream to the child node(s) // in the data graph. A button that *is* on the list -// will be processed by the qpButtonThrower and not passed +// will be processed by the ButtonThrower and not passed // on to the child node(s). // // The return value is true if the button is added, or // false if it was already in the set. //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: add_throw_button(const ModifierButtons &mods, const ButtonHandle &button) { ThrowButtonDef &def = _throw_buttons[button]; @@ -196,16 +196,16 @@ add_throw_button(const ModifierButtons &mods, const ButtonHandle &button) { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::remove_throw_button +// Function: ButtonThrower::remove_throw_button // Access: Published // Description: Removes the indicated button from the set of buttons -// that the qpButtonThrower explicitly processes. See +// that the ButtonThrower explicitly processes. See // add_throw_button(). // // The return value is true if the button is removed, or // false if it was not on the set. //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: remove_throw_button(const ModifierButtons &mods, const ButtonHandle &button) { ThrowButtons::iterator ti = _throw_buttons.find(button); if (ti == _throw_buttons.end()) { @@ -234,13 +234,13 @@ remove_throw_button(const ModifierButtons &mods, const ButtonHandle &button) { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::has_throw_button +// Function: ButtonThrower::has_throw_button // Access: Published // Description: Returns true if the indicated button is on the set of -// buttons that will be processed by the qpButtonThrower, +// buttons that will be processed by the ButtonThrower, // false otherwise. See add_throw_button(). //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: has_throw_button(const ModifierButtons &mods, const ButtonHandle &button) const { ThrowButtons::const_iterator ti = _throw_buttons.find(button); if (ti == _throw_buttons.end()) { @@ -265,17 +265,17 @@ has_throw_button(const ModifierButtons &mods, const ButtonHandle &button) const } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::has_throw_button +// Function: ButtonThrower::has_throw_button // Access: Published // Description: Returns true if the indicated button, in conjunction // with any nonspecified modifier buttons, is on the set // of buttons that will be processed by the -// qpButtonThrower. That is to say, returns true if this +// ButtonThrower. That is to say, returns true if this // button was ever passed as the second parameter // add_throw_button(), regardless of what the first // parameter was. //////////////////////////////////////////////////////////////////// -bool qpButtonThrower:: +bool ButtonThrower:: has_throw_button(const ButtonHandle &button) const { ThrowButtons::const_iterator ti = _throw_buttons.find(button); if (ti == _throw_buttons.end()) { @@ -288,25 +288,25 @@ has_throw_button(const ButtonHandle &button) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::clear_throw_buttons +// Function: ButtonThrower::clear_throw_buttons // Access: Published // Description: Empties the set of buttons that were added via // add_throw_button(). See add_throw_button(). //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: clear_throw_buttons() { _throw_buttons.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::write +// Function: ButtonThrower::write // Access: Public, Virtual // Description: Throw all events for button events found in the data // element. //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: write(ostream &out, int indent_level) const { - qpDataNode::write(out, indent_level); + DataNode::write(out, indent_level); if (_throw_buttons_active) { indent(out, indent_level) << "Processing keys:\n"; @@ -325,7 +325,7 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpButtonThrower::do_transmit_data +// Function: ButtonThrower::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -337,7 +337,7 @@ write(ostream &out, int indent_level) const { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpButtonThrower:: +void ButtonThrower:: do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) { // Clear our outgoing button events. We'll fill it up again with // just those events that want to carry on. diff --git a/panda/src/tform/qpbuttonThrower.h b/panda/src/tform/buttonThrower.h similarity index 88% rename from panda/src/tform/qpbuttonThrower.h rename to panda/src/tform/buttonThrower.h index 8bd2b7d04e..fc9bb18d80 100644 --- a/panda/src/tform/qpbuttonThrower.h +++ b/panda/src/tform/buttonThrower.h @@ -1,4 +1,4 @@ -// Filename: qpbuttonThrower.h +// Filename: buttonThrower.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,19 +16,19 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpBUTTONTHROWER_H -#define qpBUTTONTHROWER_H +#ifndef BUTTONTHROWER_H +#define BUTTONTHROWER_H #include "pandabase.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "modifierButtons.h" #include "buttonEventList.h" #include "pvector.h" #include "pmap.h" //////////////////////////////////////////////////////////////////// -// Class : qpButtonThrower +// Class : ButtonThrower // Description : Throws Panda Events for button down/up events // generated within the data graph. // @@ -39,10 +39,10 @@ // throws a corresponding event based on the button name // via the throw_event() call. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpButtonThrower : public qpDataNode { +class EXPCL_PANDA ButtonThrower : public DataNode { PUBLISHED: - qpButtonThrower(const string &name); - ~qpButtonThrower(); + ButtonThrower(const string &name); + ~ButtonThrower(); void set_prefix(const string &prefix); bool has_prefix() const; @@ -90,9 +90,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpButtonThrower", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "ButtonThrower", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/tform/config_tform.cxx b/panda/src/tform/config_tform.cxx index 242c5edd62..39de4bab42 100644 --- a/panda/src/tform/config_tform.cxx +++ b/panda/src/tform/config_tform.cxx @@ -18,13 +18,13 @@ #include "config_tform.h" -#include "qpdriveInterface.h" -#include "qpbuttonThrower.h" -#include "qpmouseWatcher.h" +#include "driveInterface.h" +#include "buttonThrower.h" +#include "mouseWatcher.h" #include "mouseWatcherGroup.h" #include "mouseWatcherRegion.h" -#include "qptrackball.h" -#include "qptransform2sg.h" +#include "trackball.h" +#include "transform2sg.h" #include @@ -44,11 +44,11 @@ const double drive_horizontal_ramp_up_time = config_tform.GetDouble("drive-horiz const double drive_horizontal_ramp_down_time = config_tform.GetDouble("drive-horizontal-ramp-down-time", 0.0); ConfigureFn(config_tform) { - qpDriveInterface::init_type(); - qpButtonThrower::init_type(); - qpMouseWatcher::init_type(); + DriveInterface::init_type(); + ButtonThrower::init_type(); + MouseWatcher::init_type(); MouseWatcherGroup::init_type(); MouseWatcherRegion::init_type(); - qpTrackball::init_type(); - qpTransform2SG::init_type(); + Trackball::init_type(); + Transform2SG::init_type(); } diff --git a/panda/src/tform/qpdriveInterface.I b/panda/src/tform/driveInterface.I similarity index 80% rename from panda/src/tform/qpdriveInterface.I rename to panda/src/tform/driveInterface.I index 85bea3b9d9..8d7dbdb17f 100644 --- a/panda/src/tform/qpdriveInterface.I +++ b/panda/src/tform/driveInterface.I @@ -1,4 +1,4 @@ -// Filename: qpdriveInterface.I +// Filename: driveInterface.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,79 +18,79 @@ //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_forward_speed +// Function: DriveInterface::set_forward_speed // Access: Published // Description: Sets the speed of full forward motion, when the mouse // is at the very top of the window. This is in units // (e.g. feet) per second. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_forward_speed(float speed) { _forward_speed = speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_forward_speed +// Function: DriveInterface::get_forward_speed // Access: Published // Description: Returns the speed of full forward motion, when the // mouse is at the very top of the window. This is in // units (e.g. feet) per second. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_forward_speed() const { return _forward_speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_reverse_speed +// Function: DriveInterface::set_reverse_speed // Access: Published // Description: Sets the speed of full reverse motion, when the mouse // is at the very bottom of the window. This is in // units (e.g. feet) per second. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_reverse_speed(float speed) { _reverse_speed = speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_reverse_speed +// Function: DriveInterface::get_reverse_speed // Access: Published // Description: Returns the speed of full reverse motion, when the // mouse is at the very bottom of the window. This is // in units (e.g. feet) per second. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_reverse_speed() const { return _reverse_speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_rotate_speed +// Function: DriveInterface::set_rotate_speed // Access: Published // Description: Sets the maximum rate at which the user can rotate // left or right, when the mouse is at the very edge of // the window. This is in degrees per second. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_rotate_speed(float speed) { _rotate_speed = speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_rotate_speed +// Function: DriveInterface::get_rotate_speed // Access: Published // Description: Returns the maximum rate at which the user can rotate // left or right, when the mouse is at the very edge of // the window. This is in degrees per second. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_rotate_speed() const { return _rotate_speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_vertical_dead_zone +// Function: DriveInterface::set_vertical_dead_zone // Access: Published // Description: Sets the size of the horizontal bar in the center of // the screen that represents the "dead zone" of @@ -99,13 +99,13 @@ get_rotate_speed() const { // the window height, so 0.5 will set a dead zone as // large as half the screen. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_vertical_dead_zone(float speed) { _vertical_dead_zone = speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_vertical_dead_zone +// Function: DriveInterface::get_vertical_dead_zone // Access: Published // Description: Returns the size of the horizontal bar in the center // of the screen that represents the "dead zone" of @@ -114,13 +114,13 @@ set_vertical_dead_zone(float speed) { // the window height, so 0.5 will set a dead zone as // large as half the screen. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_vertical_dead_zone() const { return _vertical_dead_zone; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_horizontal_dead_zone +// Function: DriveInterface::set_horizontal_dead_zone // Access: Published // Description: Sets the size of the vertical bar in the center of // the screen that represents the "dead zone" of @@ -129,13 +129,13 @@ get_vertical_dead_zone() const { // the window width, so 0.5 will set a dead zone as // large as half the screen. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_horizontal_dead_zone(float speed) { _horizontal_dead_zone = speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_horizontal_dead_zone +// Function: DriveInterface::get_horizontal_dead_zone // Access: Published // Description: Returns the size of the vertical bar in the center // of the screen that represents the "dead zone" of @@ -144,184 +144,184 @@ set_horizontal_dead_zone(float speed) { // the window width, so 0.5 will set a dead zone as // large as half the screen. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_horizontal_dead_zone() const { return _horizontal_dead_zone; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_vertical_ramp_up_time +// Function: DriveInterface::set_vertical_ramp_up_time // Access: Published // Description: Sets the amount of time, in seconds, it takes between // the time an up or down arrow key is pressed and the // time it registers full forward or backward motion. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_vertical_ramp_up_time(float ramp_up_time) { _vertical_ramp_up_time = ramp_up_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_vertical_ramp_up_time +// Function: DriveInterface::get_vertical_ramp_up_time // Access: Published // Description: Returns the amount of time, in seconds, it takes // between the time an up or down arrow key is pressed // and the time it registers full forward or backward // motion. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_vertical_ramp_up_time() const { return _vertical_ramp_up_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_vertical_ramp_down_time +// Function: DriveInterface::set_vertical_ramp_down_time // Access: Published // Description: Sets the amount of time, in seconds, it takes between // the time an up or down arrow key is released and the // time it registers no motion. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_vertical_ramp_down_time(float ramp_down_time) { _vertical_ramp_down_time = ramp_down_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_vertical_ramp_down_time +// Function: DriveInterface::get_vertical_ramp_down_time // Access: Published // Description: Returns the amount of time, in seconds, it takes // between the time an up or down arrow key is released // and the time it registers no motion. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_vertical_ramp_down_time() const { return _vertical_ramp_down_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_horizontal_ramp_up_time +// Function: DriveInterface::set_horizontal_ramp_up_time // Access: Published // Description: Sets the amount of time, in seconds, it takes between // the time a left or right arrow key is pressed and the // time it registers full rotation. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_horizontal_ramp_up_time(float ramp_up_time) { _horizontal_ramp_up_time = ramp_up_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_horizontal_ramp_up_time +// Function: DriveInterface::get_horizontal_ramp_up_time // Access: Published // Description: Returns the amount of time, in seconds, it takes // between the time a left or right arrow key is pressed // and the time it registers full rotation. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_horizontal_ramp_up_time() const { return _horizontal_ramp_up_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_horizontal_ramp_down_time +// Function: DriveInterface::set_horizontal_ramp_down_time // Access: Published // Description: Sets the amount of time, in seconds, it takes between // the time a left or right arrow key is released and the // time it registers no motion. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_horizontal_ramp_down_time(float ramp_down_time) { _horizontal_ramp_down_time = ramp_down_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_horizontal_ramp_down_time +// Function: DriveInterface::get_horizontal_ramp_down_time // Access: Published // Description: Returns the amount of time, in seconds, it takes // between the time a left or right arrow key is released // and the time it registers no motion. //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_horizontal_ramp_down_time() const { return _horizontal_ramp_down_time; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_speed +// Function: DriveInterface::get_speed // Access: Published // Description: Returns the speed of the previous update in units/sec //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_speed() const { return _speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_rot_speed +// Function: DriveInterface::get_rot_speed // Access: Published // Description: Returns the rot_speed of the previous update in units/sec //////////////////////////////////////////////////////////////////// -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_rot_speed() const { return _rot_speed; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_pos +// Function: DriveInterface::get_pos // Access: Published // Description: Returns the driver's position. //////////////////////////////////////////////////////////////////// -INLINE const LPoint3f &qpDriveInterface:: +INLINE const LPoint3f &DriveInterface:: get_pos() const { return _xyz; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_x() const { return _xyz[0]; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_y() const { return _xyz[1]; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_z() const { return _xyz[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_pos +// Function: DriveInterface::set_pos // Access: Published // Description: Directly sets the driver's position. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_pos(const LVecBase3f &vec) { _xyz = vec; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_pos(float x, float y, float z) { _xyz.set(x, y, z); recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_x(float x) { _xyz[0] = x; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_y(float y) { _xyz[1] = y; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_z(float z) { _xyz[2] = z; recompute(); @@ -329,43 +329,43 @@ set_z(float z) { //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_hpr +// Function: DriveInterface::get_hpr // Access: Published // Description: Returns the driver's orientation. //////////////////////////////////////////////////////////////////// -INLINE const LVecBase3f &qpDriveInterface:: +INLINE const LVecBase3f &DriveInterface:: get_hpr() const { return _hpr; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_h() const { return _hpr[0]; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_p() const { return _hpr[1]; } -INLINE float qpDriveInterface:: +INLINE float DriveInterface:: get_r() const { return _hpr[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_hpr +// Function: DriveInterface::set_hpr // Access: Published // Description: Directly sets the driver's orientation. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_hpr(const LVecBase3f &hpr) { _hpr = hpr; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_hpr(float h, float p, float r) { _hpr.set(h, p, r); recompute(); @@ -375,19 +375,19 @@ set_hpr(float h, float p, float r) { } } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_h(float h) { _hpr[0] = h; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_p(float p) { _hpr[1] = p; recompute(); } -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_r(float r) { _hpr[2] = r; recompute(); @@ -398,103 +398,103 @@ set_r(float r) { } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::is_force_roll +// Function: DriveInterface::is_force_roll // Access: Published // Description: Returns true if the force_roll state is in effect, // e.g. because of a previous call to set_force_roll(). // In this state, the roll cannot be set to any value // other than what the force_roll value indicates. //////////////////////////////////////////////////////////////////// -INLINE bool qpDriveInterface:: +INLINE bool DriveInterface:: is_force_roll() const { return _is_force_roll; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::clear_force_roll +// Function: DriveInterface::clear_force_roll // Access: Published // Description: Disables the force_roll state. See set_force_roll(). //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: clear_force_roll() { _is_force_roll = false; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_coordinate_system +// Function: DriveInterface::set_coordinate_system // Access: Published -// Description: Sets the coordinate system of the qpDriveInterface. +// Description: Sets the coordinate system of the DriveInterface. // Normally, this is the default coordinate system. // This changes the plane the user drives around in; // it's normally the horizontal plane (e.g. the X-Y // plane in a Z-up coordinate system, or the X-Z plane // in a Y-up coordinate system). //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_coordinate_system(CoordinateSystem cs) { _cs = cs; recompute(); } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_coordinate_system +// Function: DriveInterface::get_coordinate_system // Access: Published -// Description: Returns the coordinate system of the qpDriveInterface. +// Description: Returns the coordinate system of the DriveInterface. // See set_coordinate_system(). //////////////////////////////////////////////////////////////////// -INLINE CoordinateSystem qpDriveInterface:: +INLINE CoordinateSystem DriveInterface:: get_coordinate_system() const { return _cs; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_ignore_mouse +// Function: DriveInterface::set_ignore_mouse // Access: Published // Description: Changes the state of the ignore_mouse flag. If this -// flag is true, the qpDriveInterface will ignore mouse +// flag is true, the DriveInterface will ignore mouse // down button events (but still recognize mouse up // button events); the user will not be able to start -// the qpDriveInterface going again if it is stopped, but +// the DriveInterface going again if it is stopped, but // if the user is currently holding down a mouse button // it will not stop immediately until the user // eventually releases the button. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_ignore_mouse(bool ignore_mouse) { _ignore_mouse = ignore_mouse; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_ignore_mouse +// Function: DriveInterface::get_ignore_mouse // Access: Published // Description: Returns the current setting of the ignore_mouse flag. // See set_ignore_mouse(). //////////////////////////////////////////////////////////////////// -INLINE bool qpDriveInterface:: +INLINE bool DriveInterface:: get_ignore_mouse() const { return _ignore_mouse; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_force_mouse +// Function: DriveInterface::set_force_mouse // Access: Published // Description: Changes the state of the force_mouse flag. If this // flag is true, the mouse button need not be held down // in order to drive the avatar around. //////////////////////////////////////////////////////////////////// -INLINE void qpDriveInterface:: +INLINE void DriveInterface:: set_force_mouse(bool force_mouse) { _force_mouse = force_mouse; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_force_mouse +// Function: DriveInterface::get_force_mouse // Access: Published // Description: Returns the current setting of the force_mouse flag. // See set_force_mouse(). //////////////////////////////////////////////////////////////////// -INLINE bool qpDriveInterface:: +INLINE bool DriveInterface:: get_force_mouse() const { return _force_mouse; } diff --git a/panda/src/tform/qpdriveInterface.cxx b/panda/src/tform/driveInterface.cxx similarity index 91% rename from panda/src/tform/qpdriveInterface.cxx rename to panda/src/tform/driveInterface.cxx index 3a8061943f..ccc49d65ac 100644 --- a/panda/src/tform/qpdriveInterface.cxx +++ b/panda/src/tform/driveInterface.cxx @@ -1,4 +1,4 @@ -// Filename: qpdriveInterface.cxx +// Filename: driveInterface.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qpdriveInterface.h" +#include "driveInterface.h" #include "config_tform.h" #include "compose_matrix.h" @@ -28,11 +28,11 @@ #include "mouseButton.h" #include "buttonEventList.h" #include "dataNodeTransmit.h" -#include "qpdataGraphTraverser.h" +#include "dataGraphTraverser.h" -TypeHandle qpDriveInterface::_type_handle; +TypeHandle DriveInterface::_type_handle; -qpDriveInterface::KeyHeld:: +DriveInterface::KeyHeld:: KeyHeld() { _down = false; _changed_time = 0.0f; @@ -40,7 +40,7 @@ KeyHeld() { _effect_at_change = 0.0f; } -float qpDriveInterface::KeyHeld:: +float DriveInterface::KeyHeld:: get_effect(float ramp_up_time, float ramp_down_time) { double elapsed = ClockObject::get_global_clock()->get_frame_time() - _changed_time; @@ -70,7 +70,7 @@ get_effect(float ramp_up_time, float ramp_down_time) { return _effect; } -void qpDriveInterface::KeyHeld:: +void DriveInterface::KeyHeld:: set_key(bool down) { if (_down != down) { _down = down; @@ -79,7 +79,7 @@ set_key(bool down) { } } -void qpDriveInterface::KeyHeld:: +void DriveInterface::KeyHeld:: clear() { _down = false; _changed_time = 0.0f; @@ -87,8 +87,8 @@ clear() { _effect_at_change = 0.0f; } -bool qpDriveInterface::KeyHeld:: -operator < (const qpDriveInterface::KeyHeld &other) const { +bool DriveInterface::KeyHeld:: +operator < (const DriveInterface::KeyHeld &other) const { if (_down != other._down) { // If one has the key held down and the other doesn't, the down // key wins. @@ -100,13 +100,13 @@ operator < (const qpDriveInterface::KeyHeld &other) const { } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::Constructor +// Function: DriveInterface::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpDriveInterface:: -qpDriveInterface(const string &name) : - qpDataNode(name) +DriveInterface:: +DriveInterface(const string &name) : + DataNode(name) { _xy_input = define_input("xy", EventStoreVec2::get_class_type()); _button_events_input = define_input("button_events", ButtonEventList::get_class_type()); @@ -149,21 +149,21 @@ qpDriveInterface(const string &name) : //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::Destructor +// Function: DriveInterface::Destructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpDriveInterface:: -~qpDriveInterface() { +DriveInterface:: +~DriveInterface() { } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::reset +// Function: DriveInterface::reset // Access: Published // Description: Reinitializes the driver to the origin and resets any // knowledge about buttons being held down. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: reset() { _xyz.set(0.0f, 0.0f, 0.0f); _hpr.set(0.0f, 0.0f, 0.0f); @@ -179,14 +179,14 @@ reset() { //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_force_roll +// Function: DriveInterface::set_force_roll // Access: Published // Description: Sets the force_roll state. In this state, roll is // always fixed to a particular value (typically zero), // regardless of what it is explicitly set to via // set_hpr(). //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: set_force_roll(float force_roll) { if (_is_force_roll) { // If we already had force_roll() in effect, we have to @@ -203,13 +203,13 @@ set_force_roll(float force_roll) { } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::set_mat +// Function: DriveInterface::set_mat // Access: Published -// Description: Stores the indicated transform in the qpDriveInterface. +// Description: Stores the indicated transform in the DriveInterface. // This is a transform in global space, regardless of // the rel_to node. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: set_mat(const LMatrix4f &mat) { _mat = mat; reextract(); @@ -217,26 +217,26 @@ set_mat(const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::get_mat +// Function: DriveInterface::get_mat // Access: Published // Description: Returns the net transformation applied by the // current state. //////////////////////////////////////////////////////////////////// -const LMatrix4f &qpDriveInterface:: +const LMatrix4f &DriveInterface:: get_mat() const { return _mat; } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::force_dgraph +// Function: DriveInterface::force_dgraph // Access: Public -// Description: This is a special kludge for qpDriveInterface to allow +// Description: This is a special kludge for DriveInterface to allow // us to avoid the one-frame latency after a collision. // It forces an immediate partial data flow for all data // graph nodes below this node, causing all data nodes // that depend on this matrix to be updated immediately. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: force_dgraph() { _transform->set_value(_mat); @@ -244,20 +244,20 @@ force_dgraph() { output.reserve(get_num_outputs()); output.set_data(_transform_output, EventParameter(_transform)); - qpDataGraphTraverser dg_trav; + DataGraphTraverser dg_trav; dg_trav.traverse_below(this, output); dg_trav.collect_leftovers(); } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::apply +// Function: DriveInterface::apply // Access: Private // Description: Applies the operation indicated by the user's mouse // motion to the current state. Returns the matrix // indicating the new state. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: apply(double x, double y, bool any_button) { // First reset the speeds @@ -399,12 +399,12 @@ apply(double x, double y, bool any_button) { //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::reextract +// Function: DriveInterface::reextract // Access: Private // Description: Given a correctly computed _mat matrix, rederive the // translation and rotation elements. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: reextract() { LVecBase3f scale; @@ -423,18 +423,18 @@ reextract() { } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::recompute +// Function: DriveInterface::recompute // Access: Private // Description: Rebuilds the matrix according to the stored rotation // and translation components. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: recompute() { compose_matrix(_mat, LVecBase3f(1.0f, 1.0f, 1.0f), _hpr, _xyz, _cs); } //////////////////////////////////////////////////////////////////// -// Function: qpDriveInterface::do_transmit_data +// Function: DriveInterface::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -446,7 +446,7 @@ recompute() { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpDriveInterface:: +void DriveInterface:: do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) { // Look for mouse activity. double x = 0.0f; diff --git a/panda/src/tform/qpdriveInterface.h b/panda/src/tform/driveInterface.h similarity index 92% rename from panda/src/tform/qpdriveInterface.h rename to panda/src/tform/driveInterface.h index 129821559d..1499b39b73 100644 --- a/panda/src/tform/qpdriveInterface.h +++ b/panda/src/tform/driveInterface.h @@ -1,4 +1,4 @@ -// Filename: qpdriveInterface.h +// Filename: driveInterface.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,28 +16,28 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpDRIVEINTERFACE_H -#define qpDRIVEINTERFACE_H +#ifndef DRIVEINTERFACE_H +#define DRIVEINTERFACE_H #include "pandabase.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "modifierButtons.h" #include "luse.h" #include "linmath_events.h" //////////////////////////////////////////////////////////////////// -// Class : qpDriveInterface +// Class : DriveInterface // Description : This is a TFormer, similar to Trackball, that moves // around a transform matrix in response to mouse input. // The basic motion is on a horizontal plane, as if // driving a vehicle. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpDriveInterface : public qpDataNode { +class EXPCL_PANDA DriveInterface : public DataNode { PUBLISHED: - qpDriveInterface(const string &name = ""); - ~qpDriveInterface(); + DriveInterface(const string &name = ""); + ~DriveInterface(); INLINE void set_forward_speed(float speed); INLINE float get_forward_speed() const; @@ -181,9 +181,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpDriveInterface", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "DriveInterface", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -194,6 +194,6 @@ private: static TypeHandle _type_handle; }; -#include "qpdriveInterface.I" +#include "driveInterface.I" #endif diff --git a/panda/src/tform/qpmouseWatcher.I b/panda/src/tform/mouseWatcher.I similarity index 85% rename from panda/src/tform/qpmouseWatcher.I rename to panda/src/tform/mouseWatcher.I index 8d6481d6ea..d637f0e8a6 100644 --- a/panda/src/tform/qpmouseWatcher.I +++ b/panda/src/tform/mouseWatcher.I @@ -1,4 +1,4 @@ -// Filename: qpmouseWatcher.I +// Filename: mouseWatcher.I // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -18,37 +18,37 @@ //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::has_mouse +// Function: MouseWatcher::has_mouse // Access: Published // Description: Returns true if the mouse is anywhere within the // window, false otherwise. Also see is_mouse_open(). //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: has_mouse() const { return _has_mouse; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::is_mouse_open +// Function: MouseWatcher::is_mouse_open // Access: Published // Description: Returns true if the mouse is within the window and // not over some particular MouseWatcherRegion that is // marked to suppress mouse events; that is, that the // mouse is in open space within the window. //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: is_mouse_open() const { return _has_mouse && (_suppress_flags & MouseWatcherRegion::SF_mouse_position) == 0; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_mouse +// Function: MouseWatcher::get_mouse // Access: Published // Description: It is only valid to call this if has_mouse() returns // true. If so, this returns the current position of // the mouse within the window. //////////////////////////////////////////////////////////////////// -INLINE const LPoint2f &qpMouseWatcher:: +INLINE const LPoint2f &MouseWatcher:: get_mouse() const { #ifndef NDEBUG static LPoint2f bogus_mouse(0.0f, 0.0f); @@ -58,88 +58,88 @@ get_mouse() const { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_mouse_x +// Function: MouseWatcher::get_mouse_x // Access: Published // Description: It is only valid to call this if has_mouse() returns // true. If so, this returns the current X position of // the mouse within the window. //////////////////////////////////////////////////////////////////// -INLINE float qpMouseWatcher:: +INLINE float MouseWatcher:: get_mouse_x() const { nassertr(_has_mouse, 0.0f); return _mouse[0]; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_mouse_y +// Function: MouseWatcher::get_mouse_y // Access: Published // Description: It is only valid to call this if has_mouse() returns // true. If so, this returns the current Y position of // the mouse within the window. //////////////////////////////////////////////////////////////////// -INLINE float qpMouseWatcher:: +INLINE float MouseWatcher:: get_mouse_y() const { nassertr(_has_mouse, 0.0f); return _mouse[1]; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::is_over_region +// Function: MouseWatcher::is_over_region // Access: Published // Description: Returns true if the mouse is over any rectangular // region, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: is_over_region() const { return get_over_region() != (MouseWatcherRegion *)NULL; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::is_over_region +// Function: MouseWatcher::is_over_region // Access: Published // Description: Returns true if the mouse is over any rectangular // region, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: is_over_region(float x, float y) const { return get_over_region(x, y) != (MouseWatcherRegion *)NULL; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::is_over_region +// Function: MouseWatcher::is_over_region // Access: Published // Description: Returns true if the mouse is over any rectangular // region, false otherwise. //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: is_over_region(const LPoint2f &pos) const { return get_over_region(pos) != (MouseWatcherRegion *)NULL; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_over_region +// Function: MouseWatcher::get_over_region // Access: Published // Description: Returns the smallest region the mouse is currently // over, or NULL if it is over no region. //////////////////////////////////////////////////////////////////// -INLINE MouseWatcherRegion *qpMouseWatcher:: +INLINE MouseWatcherRegion *MouseWatcher:: get_over_region() const { return _preferred_region; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_over_region +// Function: MouseWatcher::get_over_region // Access: Published // Description: Returns the smallest region the indicated point is // over, or NULL if it is over no region. //////////////////////////////////////////////////////////////////// -INLINE MouseWatcherRegion *qpMouseWatcher:: +INLINE MouseWatcherRegion *MouseWatcher:: get_over_region(float x, float y) const { return get_over_region(LPoint2f(x, y)); } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_button_down_pattern +// Function: MouseWatcher::set_button_down_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when a button is depressed. This @@ -152,49 +152,49 @@ get_over_region(float x, float y) const { // string specified here, with all occurrences of the // above strings replaced with the corresponding values. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_button_down_pattern(const string &pattern) { _button_down_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_button_down_pattern +// Function: MouseWatcher::get_button_down_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when a button is depressed. See // set_button_down_pattern(). //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_button_down_pattern() const { return _button_down_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_button_up_pattern +// Function: MouseWatcher::set_button_up_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when a button is released. See // set_button_down_pattern(). //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_button_up_pattern(const string &pattern) { _button_up_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_button_up_pattern +// Function: MouseWatcher::get_button_up_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when a button is released. See // set_button_down_pattern(). //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_button_up_pattern() const { return _button_up_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_enter_pattern +// Function: MouseWatcher::set_enter_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when the mouse enters a region. @@ -203,13 +203,13 @@ get_button_up_pattern() const { // given time, while it might be "within" multiple // nested regions. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_enter_pattern(const string &pattern) { _enter_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_enter_pattern +// Function: MouseWatcher::get_enter_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when the mouse enters a region. This is @@ -217,13 +217,13 @@ set_enter_pattern(const string &pattern) { // only "entered" in the topmost region at a given time, // while it might be "within" multiple nested regions. //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_enter_pattern() const { return _enter_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_leave_pattern +// Function: MouseWatcher::set_leave_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when the mouse leaves a region. @@ -232,13 +232,13 @@ get_enter_pattern() const { // given time, while it might be "within" multiple // nested regions. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_leave_pattern(const string &pattern) { _leave_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_leave_pattern +// Function: MouseWatcher::get_leave_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when the mouse leaves a region. This is @@ -246,13 +246,13 @@ set_leave_pattern(const string &pattern) { // only "entered" in the topmost region at a given time, // while it might be "within" multiple nested regions. //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_leave_pattern() const { return _leave_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_within_pattern +// Function: MouseWatcher::set_within_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when the mouse wanders over a @@ -261,13 +261,13 @@ get_leave_pattern() const { // at a given time, while it might be "within" multiple // nested regions. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_within_pattern(const string &pattern) { _within_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_within_pattern +// Function: MouseWatcher::get_within_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when the mouse wanders over a region. This @@ -275,13 +275,13 @@ set_within_pattern(const string &pattern) { // only "entered" in the topmost region at a given time, // while it might be "within" multiple nested regions. //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_within_pattern() const { return _within_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_without_pattern +// Function: MouseWatcher::set_without_pattern // Access: Published // Description: Sets the pattern string that indicates how the event // names are generated when the mouse wanders out of a @@ -290,13 +290,13 @@ get_within_pattern() const { // at a given time, while it might be "within" multiple // nested regions. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_without_pattern(const string &pattern) { _without_pattern = pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_without_pattern +// Function: MouseWatcher::get_without_pattern // Access: Published // Description: Returns the string that indicates how event names are // generated when the mouse wanders out of a region. @@ -305,13 +305,13 @@ set_without_pattern(const string &pattern) { // time, while it might be "within" multiple nested // regions. //////////////////////////////////////////////////////////////////// -INLINE const string &qpMouseWatcher:: +INLINE const string &MouseWatcher:: get_without_pattern() const { return _without_pattern; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_geometry +// Function: MouseWatcher::set_geometry // Access: Published // Description: Sets the node that will be transformed each frame by // the mouse's coordinates. It will also be hidden when @@ -319,100 +319,100 @@ get_without_pattern() const { // to implement a software mouse pointer for when a // hardware (or system) mouse pointer is unavailable. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_geometry(PandaNode *node) { _geometry = node; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::has_geometry +// Function: MouseWatcher::has_geometry // Access: Published // Description: Returns true if a software mouse pointer has been // setup via set_geometry(), or false otherwise. See // set_geometry(). //////////////////////////////////////////////////////////////////// -INLINE bool qpMouseWatcher:: +INLINE bool MouseWatcher:: has_geometry() const { return !_geometry.is_null(); } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_geometry +// Function: MouseWatcher::get_geometry // Access: Published // Description: Returns the node that has been set as the software // mouse pointer, or NULL if no node has been set. See // has_geometry() and set_geometry(). //////////////////////////////////////////////////////////////////// -INLINE PandaNode *qpMouseWatcher:: +INLINE PandaNode *MouseWatcher:: get_geometry() const { return _geometry; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::clear_geometry +// Function: MouseWatcher::clear_geometry // Access: Published // Description: Stops the use of the software cursor set up via // set_geometry(). //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: clear_geometry() { _geometry.clear(); } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_extra_handler +// Function: MouseWatcher::set_extra_handler // Access: Published // Description: As an optimization for the C++ Gui, an extra handler // can be registered with a mouseWatcher so that events // can be dealt with much sooner. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_extra_handler(EventHandler *eh) { _eh = eh; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_extra_handler +// Function: MouseWatcher::get_extra_handler // Access: Published // Description: As an optimization for the C++ Gui, an extra handler // can be registered with a mouseWatcher so that events // can be dealt with much sooner. //////////////////////////////////////////////////////////////////// -INLINE EventHandler *qpMouseWatcher:: +INLINE EventHandler *MouseWatcher:: get_extra_handler(void) const { return _eh; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_modifier_buttons +// Function: MouseWatcher::set_modifier_buttons // Access: Public // Description: Sets the buttons that should be monitored as modifier // buttons for generating events to the // MouseWatcherRegions. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: set_modifier_buttons(const ModifierButtons &mods) { _mods = mods; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_modifier_buttons +// Function: MouseWatcher::get_modifier_buttons // Access: Published // Description: Returns the set of buttons that are being monitored // as modifier buttons, as well as their current state. //////////////////////////////////////////////////////////////////// -INLINE ModifierButtons qpMouseWatcher:: +INLINE ModifierButtons MouseWatcher:: get_modifier_buttons() const { return _mods; } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::within_region +// Function: MouseWatcher::within_region // Access: Protected // Description: Called internally to indicate the mouse pointer has // moved within the indicated region's boundaries. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: within_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { region->within(param); throw_event_pattern(_within_pattern, region, ButtonHandle::none()); @@ -422,12 +422,12 @@ within_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::without_region +// Function: MouseWatcher::without_region // Access: Protected // Description: Called internally to indicate the mouse pointer has // moved outside of the indicated region's boundaries. //////////////////////////////////////////////////////////////////// -INLINE void qpMouseWatcher:: +INLINE void MouseWatcher:: without_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { if (_enter_multiple) { exit_region(region, param); diff --git a/panda/src/tform/qpmouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx similarity index 92% rename from panda/src/tform/qpmouseWatcher.cxx rename to panda/src/tform/mouseWatcher.cxx index 32e352716f..586a17df68 100644 --- a/panda/src/tform/qpmouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -1,4 +1,4 @@ -// Filename: qpmouseWatcher.cxx +// Filename: mouseWatcher.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qpmouseWatcher.h" +#include "mouseWatcher.h" #include "config_tform.h" #include "mouseWatcherParameter.h" #include "mouseAndKeyboard.h" @@ -31,16 +31,16 @@ #include -TypeHandle qpMouseWatcher::_type_handle; +TypeHandle MouseWatcher::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::Constructor +// Function: MouseWatcher::Constructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpMouseWatcher:: -qpMouseWatcher(const string &name) : - qpDataNode(name) +MouseWatcher:: +MouseWatcher(const string &name) : + DataNode(name) { _pixel_xy_input = define_input("pixel_xy", EventStoreVec2::get_class_type()); _xy_input = define_input("xy", EventStoreVec2::get_class_type()); @@ -74,22 +74,22 @@ qpMouseWatcher(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::Destructor +// Function: MouseWatcher::Destructor // Access: Published // Description: //////////////////////////////////////////////////////////////////// -qpMouseWatcher:: -~qpMouseWatcher() { +MouseWatcher:: +~MouseWatcher() { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::remove_region +// Function: MouseWatcher::remove_region // Access: Published // Description: Removes the indicated region from the group. // Returns true if it was successfully removed, or false // if it wasn't there in the first place. //////////////////////////////////////////////////////////////////// -bool qpMouseWatcher:: +bool MouseWatcher:: remove_region(MouseWatcherRegion *region) { remove_region_from(_current_regions, region); if (region == _preferred_region) { @@ -103,7 +103,7 @@ remove_region(MouseWatcherRegion *region) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_over_region +// Function: MouseWatcher::get_over_region // Access: Published // Description: Returns the preferred region the mouse is over. In // the case of overlapping regions, the region with the @@ -111,7 +111,7 @@ remove_region(MouseWatcherRegion *region) { // the same sort order, then the smaller region is // preferred. //////////////////////////////////////////////////////////////////// -MouseWatcherRegion *qpMouseWatcher:: +MouseWatcherRegion *MouseWatcher:: get_over_region(const LPoint2f &pos) const { VRegions regions; get_over_regions(regions, pos); @@ -120,13 +120,13 @@ get_over_region(const LPoint2f &pos) const { //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::output +// Function: MouseWatcher::output // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: output(ostream &out) const { - qpDataNode::output(out); + DataNode::output(out); int count = _regions.size(); Groups::const_iterator gi; @@ -139,11 +139,11 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::write +// Function: MouseWatcher::write // Access: Public, Virtual // Description: //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: write(ostream &out, int indent_level) const { indent(out, indent_level) << "MouseWatcher " << get_name() << ":\n"; @@ -168,7 +168,7 @@ write(ostream &out, int indent_level) const { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::add_group +// Function: MouseWatcher::add_group // Access: Public // Description: Adds the indicated group of regions to the set of // regions the MouseWatcher will monitor each frame. @@ -183,7 +183,7 @@ write(ostream &out, int indent_level) const { // Returns true if the group was successfully added, or // false if it was already on the list. //////////////////////////////////////////////////////////////////// -bool qpMouseWatcher:: +bool MouseWatcher:: add_group(MouseWatcherGroup *group) { // return _groups.insert(group).second; @@ -202,14 +202,14 @@ add_group(MouseWatcherGroup *group) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::remove_group +// Function: MouseWatcher::remove_group // Access: Public // Description: Removes the indicated group from the set of extra // groups associated with the MouseWatcher. Returns // true if successful, or false if the group was already // removed or was never added via add_group(). //////////////////////////////////////////////////////////////////// -bool qpMouseWatcher:: +bool MouseWatcher:: remove_group(MouseWatcherGroup *group) { remove_regions_from(_current_regions, group); if (group->has_region(_preferred_region)) { @@ -234,14 +234,14 @@ remove_group(MouseWatcherGroup *group) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_over_regions +// Function: MouseWatcher::get_over_regions // Access: Protected // Description: Fills up the "regions" list with the set of regions // that the indicated point is over, sorted in order by // pointer. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: -get_over_regions(qpMouseWatcher::VRegions ®ions, const LPoint2f &pos) const { +void MouseWatcher:: +get_over_regions(MouseWatcher::VRegions ®ions, const LPoint2f &pos) const { // Ensure the vector is empty before we begin. regions.clear(); @@ -282,15 +282,15 @@ get_over_regions(qpMouseWatcher::VRegions ®ions, const LPoint2f &pos) const { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::get_preferred_region +// Function: MouseWatcher::get_preferred_region // Access: Protected, Static // Description: Returns the innermost region of all the regions // indicated in the given vector (usually, the regions // the mouse is over). This is the "preferred" region // that gets some special treatment. //////////////////////////////////////////////////////////////////// -MouseWatcherRegion *qpMouseWatcher:: -get_preferred_region(const qpMouseWatcher::VRegions ®ions) { +MouseWatcherRegion *MouseWatcher:: +get_preferred_region(const MouseWatcher::VRegions ®ions) { if (regions.empty()) { return (MouseWatcherRegion *)NULL; } @@ -312,7 +312,7 @@ get_preferred_region(const qpMouseWatcher::VRegions ®ions) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::set_current_regions +// Function: MouseWatcher::set_current_regions // Access: Protected // Description: Changes the "current" regions--the one we consider the // mouse to be over--to the indicated list, and throws @@ -320,8 +320,8 @@ get_preferred_region(const qpMouseWatcher::VRegions ®ions) { // // The list passed in is destroyed. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: -set_current_regions(qpMouseWatcher::VRegions ®ions) { +void MouseWatcher:: +set_current_regions(MouseWatcher::VRegions ®ions) { // Set up a parameter for passing through any change events. MouseWatcherParameter param; param.set_modifier_buttons(_mods); @@ -413,11 +413,11 @@ set_current_regions(qpMouseWatcher::VRegions ®ions) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::clear_current_regions +// Function: MouseWatcher::clear_current_regions // Access: Protected // Description: Empties the set of current regions. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: clear_current_regions() { if (!_current_regions.empty()) { // Set up a parameter for passing through any change events. @@ -446,17 +446,17 @@ clear_current_regions() { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::intersect_regions +// Function: MouseWatcher::intersect_regions // Access: Protected, Static // Description: Sets result to be the intersection of the list of // regions in regions_a and regions_b. It is assumed // that both vectors are already sorted in pointer // order. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: -intersect_regions(qpMouseWatcher::VRegions &result, - const qpMouseWatcher::VRegions ®ions_a, - const qpMouseWatcher::VRegions ®ions_b) { +void MouseWatcher:: +intersect_regions(MouseWatcher::VRegions &result, + const MouseWatcher::VRegions ®ions_a, + const MouseWatcher::VRegions ®ions_b) { // Get a temporary vector for storing the result in. We don't use // result directly, because it might be the same vector as one of a // or b. @@ -488,13 +488,13 @@ intersect_regions(qpMouseWatcher::VRegions &result, } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::remove_region_from +// Function: MouseWatcher::remove_region_from // Access: Protected, Static // Description: Removes the indicated region from the given vector. // Assumes the vector is sorted in pointer order. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: -remove_region_from(qpMouseWatcher::VRegions ®ions, +void MouseWatcher:: +remove_region_from(MouseWatcher::VRegions ®ions, MouseWatcherRegion *region) { VRegions::iterator ri = lower_bound(regions.begin(), regions.end(), region); @@ -505,14 +505,14 @@ remove_region_from(qpMouseWatcher::VRegions ®ions, } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::remove_regions_from +// Function: MouseWatcher::remove_regions_from // Access: Protected, Static // Description: Removes all the regions in the indicated group from // the given vector. Assumes the vector is sorted in // pointer order. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: -remove_regions_from(qpMouseWatcher::VRegions ®ions, +void MouseWatcher:: +remove_regions_from(MouseWatcher::VRegions ®ions, MouseWatcherGroup *group) { // Since the group stores a set of regions, which are also sorted in // pointer order, we can just do an intersection operation here. @@ -543,12 +543,12 @@ remove_regions_from(qpMouseWatcher::VRegions ®ions, } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::throw_event_for +// Function: MouseWatcher::throw_event_for // Access: Protected // Description: Throws an event associated with the indicated region, // using the given pattern. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: throw_event_pattern(const string &pattern, const MouseWatcherRegion *region, const ButtonHandle &button) { if (pattern.empty()) { @@ -601,12 +601,12 @@ throw_event_pattern(const string &pattern, const MouseWatcherRegion *region, } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::press +// Function: MouseWatcher::press // Access: Protected // Description: Records the indicated mouse or keyboard button as // being depressed. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: press(ButtonHandle button) { MouseWatcherParameter param; param.set_button(button); @@ -649,12 +649,12 @@ press(ButtonHandle button) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::release +// Function: MouseWatcher::release // Access: Protected // Description: Records the indicated mouse or keyboard button as // being released. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: release(ButtonHandle button) { MouseWatcherParameter param; param.set_button(button); @@ -692,12 +692,12 @@ release(ButtonHandle button) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::keystroke +// Function: MouseWatcher::keystroke // Access: Protected // Description: Records that the indicated keystroke has been // generated. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: keystroke(int keycode) { MouseWatcherParameter param; param.set_keycode(keycode); @@ -736,13 +736,13 @@ keystroke(int keycode) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::global_keyboard_press +// Function: MouseWatcher::global_keyboard_press // Access: Protected // Description: Calls press() on all regions that are interested in // receiving global keyboard events, except for the // current region (which already received this one). //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: global_keyboard_press(const MouseWatcherParameter ¶m) { Regions::const_iterator ri; for (ri = _regions.begin(); ri != _regions.end(); ++ri) { @@ -767,13 +767,13 @@ global_keyboard_press(const MouseWatcherParameter ¶m) { } } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::global_keyboard_release +// Function: MouseWatcher::global_keyboard_release // Access: Protected // Description: Calls release() on all regions that are interested in // receiving global keyboard events, except for the // current region (which already received this one). //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: global_keyboard_release(const MouseWatcherParameter ¶m) { Regions::const_iterator ri; for (ri = _regions.begin(); ri != _regions.end(); ++ri) { @@ -799,12 +799,12 @@ global_keyboard_release(const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::enter_region +// Function: MouseWatcher::enter_region // Access: Protected // Description: Called internally to indicate the mouse pointer is no // longer favoring the indicated region. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: enter_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { region->enter(param); throw_event_pattern(_enter_pattern, region, ButtonHandle::none()); @@ -816,12 +816,12 @@ enter_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::exit_region +// Function: MouseWatcher::exit_region // Access: Protected // Description: Called internally to indicate the mouse pointer is no // longer favoring the indicated region. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: exit_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { if (_implicit_click) { MouseWatcherParameter param1(param); @@ -833,7 +833,7 @@ exit_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { } //////////////////////////////////////////////////////////////////// -// Function: qpMouseWatcher::do_transmit_data +// Function: MouseWatcher::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -845,7 +845,7 @@ exit_region(MouseWatcherRegion *region, const MouseWatcherParameter ¶m) { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpMouseWatcher:: +void MouseWatcher:: do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) { if (!input.has_data(_xy_input)) { // No mouse in the window. diff --git a/panda/src/tform/qpmouseWatcher.h b/panda/src/tform/mouseWatcher.h similarity index 89% rename from panda/src/tform/qpmouseWatcher.h rename to panda/src/tform/mouseWatcher.h index 20f1429fd3..12df183e51 100644 --- a/panda/src/tform/qpmouseWatcher.h +++ b/panda/src/tform/mouseWatcher.h @@ -1,4 +1,4 @@ -// Filename: qpmouseWatcher.h +// Filename: mouseWatcher.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,14 +16,14 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpMOUSEWATCHER_H -#define qpMOUSEWATCHER_H +#ifndef MOUSEWATCHER_H +#define MOUSEWATCHER_H #include "pandabase.h" #include "mouseWatcherRegion.h" #include "mouseWatcherGroup.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "luse.h" #include "pointerTo.h" #include "eventHandler.h" @@ -53,10 +53,10 @@ class MouseWatcherParameter; // scene graph. It will move the geometry around // according to the mouse's known position. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpMouseWatcher : public qpDataNode, public MouseWatcherGroup { +class EXPCL_PANDA MouseWatcher : public DataNode, public MouseWatcherGroup { PUBLISHED: - qpMouseWatcher(const string &name = ""); - ~qpMouseWatcher(); + MouseWatcher(const string &name = ""); + ~MouseWatcher(); bool remove_region(MouseWatcherRegion *region); @@ -117,12 +117,12 @@ protected: void set_current_regions(VRegions ®ions); void clear_current_regions(); - static void intersect_regions(qpMouseWatcher::VRegions &result, - const qpMouseWatcher::VRegions ®ions_a, - const qpMouseWatcher::VRegions ®ions_b); - static void remove_region_from(qpMouseWatcher::VRegions ®ions, + static void intersect_regions(MouseWatcher::VRegions &result, + const MouseWatcher::VRegions ®ions_a, + const MouseWatcher::VRegions ®ions_b); + static void remove_region_from(MouseWatcher::VRegions ®ions, MouseWatcherRegion *region); - static void remove_regions_from(qpMouseWatcher::VRegions ®ions, + static void remove_regions_from(MouseWatcher::VRegions ®ions, MouseWatcherGroup *group); @@ -196,9 +196,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpMouseWatcher", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "MouseWatcher", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -209,6 +209,6 @@ private: static TypeHandle _type_handle; }; -#include "qpmouseWatcher.I" +#include "mouseWatcher.I" #endif diff --git a/panda/src/tform/mouseWatcherGroup.h b/panda/src/tform/mouseWatcherGroup.h index c463bb367f..92aee8e86f 100644 --- a/panda/src/tform/mouseWatcherGroup.h +++ b/panda/src/tform/mouseWatcherGroup.h @@ -58,7 +58,6 @@ private: static TypeHandle _type_handle; friend class MouseWatcher; - friend class qpMouseWatcher; friend class BlobWatcher; }; diff --git a/panda/src/tform/tform_composite1.cxx b/panda/src/tform/tform_composite1.cxx index 75c049aeb7..36f27f3384 100644 --- a/panda/src/tform/tform_composite1.cxx +++ b/panda/src/tform/tform_composite1.cxx @@ -1,5 +1,5 @@ -#include "qpbuttonThrower.cxx" +#include "buttonThrower.cxx" #include "config_tform.cxx" -#include "qpdriveInterface.cxx" +#include "driveInterface.cxx" diff --git a/panda/src/tform/tform_composite2.cxx b/panda/src/tform/tform_composite2.cxx index e09a19fbb5..8b5e2f3d99 100644 --- a/panda/src/tform/tform_composite2.cxx +++ b/panda/src/tform/tform_composite2.cxx @@ -1,8 +1,8 @@ -#include "qpmouseWatcher.cxx" +#include "mouseWatcher.cxx" #include "mouseWatcherGroup.cxx" #include "mouseWatcherParameter.cxx" #include "mouseWatcherRegion.cxx" -#include "qptrackball.cxx" -#include "qptransform2sg.cxx" +#include "trackball.cxx" +#include "transform2sg.cxx" diff --git a/panda/src/tform/qptrackball.cxx b/panda/src/tform/trackball.cxx similarity index 88% rename from panda/src/tform/qptrackball.cxx rename to panda/src/tform/trackball.cxx index 85ea26a60c..84fcf23b08 100644 --- a/panda/src/tform/qptrackball.cxx +++ b/panda/src/tform/trackball.cxx @@ -1,4 +1,4 @@ -// Filename: qptrackball.cxx +// Filename: trackball.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////// -#include "qptrackball.h" +#include "trackball.h" #include "buttonEvent.h" #include "buttonEventList.h" #include "dataNodeTransmit.h" @@ -24,7 +24,7 @@ #include "mouseData.h" #include "modifierButtons.h" -TypeHandle qpTrackball::_type_handle; +TypeHandle Trackball::_type_handle; // These are used internally. #define B1_MASK 0x1 @@ -32,13 +32,13 @@ TypeHandle qpTrackball::_type_handle; #define B3_MASK 0x4 //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::Constructor +// Function: Trackball::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpTrackball:: -qpTrackball(const string &name) : - qpDataNode(name) +Trackball:: +Trackball(const string &name) : + DataNode(name) { _pixel_xy_input = define_input("pixel_xy", EventStoreVec2::get_class_type()); _button_events_input = define_input("button_events", ButtonEventList::get_class_type()); @@ -65,20 +65,20 @@ qpTrackball(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::Destructor +// Function: Trackball::Destructor // Access: Public, Scheme // Description: //////////////////////////////////////////////////////////////////// -qpTrackball:: -~qpTrackball() { +Trackball:: +~Trackball() { } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::reset +// Function: Trackball::reset // Access: Public, Scheme // Description: Reinitializes all transforms to identity. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: reset() { _rotation = LMatrix4f::ident_mat(); _translation.set(0.0f, 0.0f, 0.0f); @@ -88,61 +88,61 @@ reset() { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_pos +// Function: Trackball::get_pos // Access: Public, Scheme // Description: Return the offset from the center of rotation. //////////////////////////////////////////////////////////////////// -const LPoint3f &qpTrackball:: +const LPoint3f &Trackball:: get_pos() const { return _translation; } -float qpTrackball:: +float Trackball:: get_x() const { return _translation[0]; } -float qpTrackball:: +float Trackball:: get_y() const { return _translation[1]; } -float qpTrackball:: +float Trackball:: get_z() const { return _translation[2]; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_pos +// Function: Trackball::set_pos // Access: Public, Scheme // Description: Directly set the offset from the rotational origin. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: set_pos(const LVecBase3f &vec) { _translation = vec; recompute(); } -void qpTrackball:: +void Trackball:: set_pos(float x, float y, float z) { _translation.set(x, y, z); recompute(); } -void qpTrackball:: +void Trackball:: set_x(float x) { _translation[0] = x; recompute(); } -void qpTrackball:: +void Trackball:: set_y(float y) { _translation[1] = y; recompute(); } -void qpTrackball:: +void Trackball:: set_z(float z) { _translation[2] = z; recompute(); @@ -150,32 +150,32 @@ set_z(float z) { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_hpr +// Function: Trackball::get_hpr // Access: Public, Scheme // Description: Return the trackball's orientation. //////////////////////////////////////////////////////////////////// -LVecBase3f qpTrackball:: +LVecBase3f Trackball:: get_hpr() const { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); return hpr; } -float qpTrackball:: +float Trackball:: get_h() const { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); return hpr[0]; } -float qpTrackball:: +float Trackball:: get_p() const { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); return hpr[1]; } -float qpTrackball:: +float Trackball:: get_r() const { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); @@ -184,11 +184,11 @@ get_r() const { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_hpr +// Function: Trackball::set_hpr // Access: Public, Scheme // Description: Directly set the mover's orientation. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: set_hpr(const LVecBase3f &hpr) { LVecBase3f scale, old_hpr, translate; decompose_matrix(_rotation, scale, old_hpr, translate); @@ -196,7 +196,7 @@ set_hpr(const LVecBase3f &hpr) { recompute(); } -void qpTrackball:: +void Trackball:: set_hpr(float h, float p, float r) { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); @@ -205,7 +205,7 @@ set_hpr(float h, float p, float r) { recompute(); } -void qpTrackball:: +void Trackball:: set_h(float h) { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); @@ -214,7 +214,7 @@ set_h(float h) { recompute(); } -void qpTrackball:: +void Trackball:: set_p(float p) { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); @@ -223,7 +223,7 @@ set_p(float p) { recompute(); } -void qpTrackball:: +void Trackball:: set_r(float r) { LVecBase3f scale, hpr, translate; decompose_matrix(_rotation, scale, hpr, translate); @@ -234,13 +234,13 @@ set_r(float r) { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::reset_origin_here +// Function: Trackball::reset_origin_here // Access: Public, Scheme // Description: Reposition the center of rotation to coincide with // the current translation offset. Future rotations // will be about the current origin. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: reset_origin_here() { recompute(); _rotation = _orig; @@ -249,42 +249,42 @@ reset_origin_here() { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::move_origin +// Function: Trackball::move_origin // Access: Public, Scheme // Description: Moves the center of rotation by the given amount. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: move_origin(float x, float y, float z) { _rotation = LMatrix4f::translate_mat(LVecBase3f(x, y, z)) * _rotation; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_invert +// Function: Trackball::set_invert // Access: Public, Scheme // Description: Sets the invert flag. When this is set, the inverse // matrix is generated, suitable for joining to a // camera, instead of parenting the scene under it. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: set_invert(bool flag) { _invert = flag; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_invert +// Function: Trackball::get_invert // Access: Public, Scheme // Description: Returns the invert flag. When this is set, the // inverse matrix is generated, suitable for joining to // a camera, instead of parenting the scene under it. //////////////////////////////////////////////////////////////////// -bool qpTrackball:: +bool Trackball:: get_invert() const { return _invert; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_rel_to +// Function: Trackball::set_rel_to // Access: Public, Scheme // Description: Sets the NodePath that all trackball manipulations // are to be assumed to be relative to. For instance, @@ -293,25 +293,25 @@ get_invert() const { // path, which means trackball motion is in global // space. //////////////////////////////////////////////////////////////////// -void qpTrackball:: -set_rel_to(const qpNodePath &rel_to) { +void Trackball:: +set_rel_to(const NodePath &rel_to) { _rel_to = rel_to; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_rel_to +// Function: Trackball::get_rel_to // Access: Public, Scheme // Description: Returns the NodePath that all trackball manipulations // are relative to, or the empty path. //////////////////////////////////////////////////////////////////// -const qpNodePath &qpTrackball:: +const NodePath &Trackball:: get_rel_to() const { return _rel_to; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_coordinate_system +// Function: Trackball::set_coordinate_system // Access: Public, Scheme // Description: Sets the coordinate system of the Trackball. // Normally, this is the default coordinate system. @@ -319,30 +319,30 @@ get_rel_to() const { // that the user interface remains consistent across // different coordinate systems. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: set_coordinate_system(CoordinateSystem cs) { _cs = cs; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_coordinate_system +// Function: Trackball::get_coordinate_system // Access: Public, Scheme // Description: Returns the coordinate system of the Trackball. // See set_coordinate_system(). //////////////////////////////////////////////////////////////////// -CoordinateSystem qpTrackball:: +CoordinateSystem Trackball:: get_coordinate_system() const { return _cs; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::set_mat +// Function: Trackball::set_mat // Access: Public, Scheme // Description: Stores the indicated transform in the trackball. // This is a transform in global space, regardless of // the rel_to node. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: set_mat(const LMatrix4f &mat) { _orig = mat; if (_invert) { @@ -356,37 +356,37 @@ set_mat(const LMatrix4f &mat) { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_mat +// Function: Trackball::get_mat // Access: Public, Scheme // Description: Returns the matrix represented by the trackball // rotation. //////////////////////////////////////////////////////////////////// -const LMatrix4f &qpTrackball:: +const LMatrix4f &Trackball:: get_mat() const { return _orig; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::get_trans_mat +// Function: Trackball::get_trans_mat // Access: Public, Scheme // Description: Returns the actual transform that will be applied to // the scene graph. This is the same as get_mat(), // unless invert is in effect. //////////////////////////////////////////////////////////////////// -const LMatrix4f &qpTrackball:: +const LMatrix4f &Trackball:: get_trans_mat() const { return _mat; } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::apply +// Function: Trackball::apply // Access: Private // Description: Applies the operation indicated by the user's mouse // motion to the current state. Returns the matrix // indicating the new state. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: apply(double x, double y, int button) { if (button && !_rel_to.is_empty()) { // If we have a rel_to node, we must first adjust our rotation and @@ -431,16 +431,16 @@ apply(double x, double y, int button) { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::reextract +// Function: Trackball::reextract // Access: Private // Description: Given a correctly computed _orig matrix, rederive the // translation and rotation elements. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: reextract() { LMatrix4f m = _orig; if (!_rel_to.is_empty()) { - qpNodePath root; + NodePath root; const LMatrix4f &rel_mat = root.get_mat(_rel_to); m = _orig * rel_mat; } @@ -451,17 +451,17 @@ reextract() { } //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::recompute +// Function: Trackball::recompute // Access: Private // Description: Rebuilds the matrix according to the stored rotation // and translation components. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: recompute() { _orig = _rotation * LMatrix4f::translate_mat(_translation); if (!_rel_to.is_empty()) { - qpNodePath root; + NodePath root; const LMatrix4f &rel_mat = _rel_to.get_mat(root); _orig = _orig * rel_mat; } @@ -475,7 +475,7 @@ recompute() { //////////////////////////////////////////////////////////////////// -// Function: qpTrackball::do_transmit_data +// Function: Trackball::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -487,7 +487,7 @@ recompute() { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpTrackball:: +void Trackball:: do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &output) { // First, update our modifier buttons. if (input.has_data(_button_events_input)) { diff --git a/panda/src/tform/qptrackball.h b/panda/src/tform/trackball.h similarity index 87% rename from panda/src/tform/qptrackball.h rename to panda/src/tform/trackball.h index f38a52d59b..7352fcf7f2 100644 --- a/panda/src/tform/qptrackball.h +++ b/panda/src/tform/trackball.h @@ -1,4 +1,4 @@ -// Filename: qptrackball.h +// Filename: trackball.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,20 +16,20 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpTRACKBALL_H -#define qpTRACKBALL_H +#ifndef TRACKBALL_H +#define TRACKBALL_H #include "pandabase.h" -#include "qpdataNode.h" -#include "qpnodePath.h" +#include "dataNode.h" +#include "nodePath.h" #include "modifierButtons.h" #include "luse.h" #include "linmath_events.h" //////////////////////////////////////////////////////////////////// -// Class : qpTrackball +// Class : Trackball // Description : Trackball acts like Performer in trackball mode. It // can either spin around a piece of geometry directly, // or it can spin around a camera with the inverse @@ -41,10 +41,10 @@ // it to actually transform objects (or cameras) in the // world. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpTrackball : public qpDataNode { +class EXPCL_PANDA Trackball : public DataNode { PUBLISHED: - qpTrackball(const string &name); - ~qpTrackball(); + Trackball(const string &name); + ~Trackball(); void reset(); @@ -82,8 +82,8 @@ PUBLISHED: void set_invert(bool flag); bool get_invert() const; - void set_rel_to(const qpNodePath &_rel_to); - const qpNodePath &get_rel_to() const; + void set_rel_to(const NodePath &_rel_to); + const NodePath &get_rel_to() const; void set_coordinate_system(CoordinateSystem cs); CoordinateSystem get_coordinate_system() const; @@ -109,7 +109,7 @@ private: LPoint3f _translation; LMatrix4f _mat, _orig; bool _invert; - qpNodePath _rel_to; + NodePath _rel_to; CoordinateSystem _cs; // Remember which mouse buttons are being held down. @@ -136,9 +136,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpTrackball", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "Trackball", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); diff --git a/panda/src/tform/qptransform2sg.cxx b/panda/src/tform/transform2sg.cxx similarity index 86% rename from panda/src/tform/qptransform2sg.cxx rename to panda/src/tform/transform2sg.cxx index ae6e8936ed..99f8373d13 100644 --- a/panda/src/tform/qptransform2sg.cxx +++ b/panda/src/tform/transform2sg.cxx @@ -1,4 +1,4 @@ -// Filename: qptransform2sg.cxx +// Filename: transform2sg.cxx // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,20 +16,20 @@ // //////////////////////////////////////////////////////////////////// -#include "qptransform2sg.h" +#include "transform2sg.h" #include "transformState.h" -TypeHandle qpTransform2SG::_type_handle; +TypeHandle Transform2SG::_type_handle; //////////////////////////////////////////////////////////////////// -// Function: qpTransform2SG::Constructor +// Function: Transform2SG::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// -qpTransform2SG:: -qpTransform2SG(const string &name) : - qpDataNode(name) +Transform2SG:: +Transform2SG(const string &name) : + DataNode(name) { _transform_input = define_input("transform", EventStoreMat4::get_class_type()); @@ -37,29 +37,29 @@ qpTransform2SG(const string &name) : } //////////////////////////////////////////////////////////////////// -// Function: qpTransform2SG::set_node +// Function: Transform2SG::set_node // Access: Public // Description: Sets the node that this node will adjust. //////////////////////////////////////////////////////////////////// -void qpTransform2SG:: +void Transform2SG:: set_node(PandaNode *node) { _node = node; } //////////////////////////////////////////////////////////////////// -// Function: qpTransform2SG::get_node +// Function: Transform2SG::get_node // Access: Public // Description: Returns the node that this node will adjust, or NULL // if the node has not yet been set. //////////////////////////////////////////////////////////////////// -PandaNode *qpTransform2SG:: +PandaNode *Transform2SG:: get_node() const { return _node; } //////////////////////////////////////////////////////////////////// -// Function: qpTransform2SG::do_transmit_data +// Function: Transform2SG::do_transmit_data // Access: Protected, Virtual // Description: The virtual implementation of transmit_data(). This // function receives an array of input parameters and @@ -71,7 +71,7 @@ get_node() const { // the index numbers returned by the define_output() // calls. //////////////////////////////////////////////////////////////////// -void qpTransform2SG:: +void Transform2SG:: do_transmit_data(const DataNodeTransmit &input, DataNodeTransmit &) { if (input.has_data(_transform_input)) { const EventStoreMat4 *transform; diff --git a/panda/src/tform/qptransform2sg.h b/panda/src/tform/transform2sg.h similarity index 81% rename from panda/src/tform/qptransform2sg.h rename to panda/src/tform/transform2sg.h index 7cb8e750df..074746e6b6 100644 --- a/panda/src/tform/qptransform2sg.h +++ b/panda/src/tform/transform2sg.h @@ -1,4 +1,4 @@ -// Filename: qptransform2sg.h +// Filename: transform2sg.h // Created by: drose (12Mar02) // //////////////////////////////////////////////////////////////////// @@ -16,24 +16,24 @@ // //////////////////////////////////////////////////////////////////// -#ifndef qpTRANSFORM2SG_H -#define qpTRANSFORM2SG_H +#ifndef TRANSFORM2SG_H +#define TRANSFORM2SG_H #include "pandabase.h" -#include "qpdataNode.h" +#include "dataNode.h" #include "pandaNode.h" //////////////////////////////////////////////////////////////////// -// Class : qpTransform2SG +// Class : Transform2SG // Description : input: Transform (matrix) // // output: none, but applies the matrix as the transform // transition for a given arc of the scene graph. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA qpTransform2SG : public qpDataNode { +class EXPCL_PANDA Transform2SG : public DataNode { PUBLISHED: - qpTransform2SG(const string &name); + Transform2SG(const string &name); void set_node(PandaNode *node); PandaNode *get_node() const; @@ -55,9 +55,9 @@ public: return _type_handle; } static void init_type() { - qpDataNode::init_type(); - register_type(_type_handle, "qpTransform2SG", - qpDataNode::get_class_type()); + DataNode::init_type(); + register_type(_type_handle, "Transform2SG", + DataNode::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type();