MouseDialogNavigationToolFactory::MouseDialogNavigationToolFactory(ToolManager& toolManager) :ToolFactory("MouseDialogNavigationTool",toolManager), rotatePlaneOffset(getInchFactor()*Scalar(3)), rotateFactor(getInchFactor()*Scalar(3)), screenDollyingDirection(0,-1,0), screenScalingDirection(0,-1,0), dollyFactor(Scalar(1)), scaleFactor(getInchFactor()*Scalar(3)), spinThreshold(getUiSize()*Scalar(2)), interactWithWidgets(true) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); rotatePlaneOffset=cfs.retrieveValue<Scalar>("./rotatePlaneOffset",rotatePlaneOffset); rotateFactor=cfs.retrieveValue<Scalar>("./rotateFactor",rotateFactor); screenDollyingDirection=cfs.retrieveValue<Vector>("./screenDollyingDirection",screenDollyingDirection); screenScalingDirection=cfs.retrieveValue<Vector>("./screenScalingDirection",screenScalingDirection); dollyFactor=cfs.retrieveValue<Scalar>("./dollyFactor",dollyFactor); scaleFactor=cfs.retrieveValue<Scalar>("./scaleFactor",scaleFactor); spinThreshold=cfs.retrieveValue<Scalar>("./spinThreshold",spinThreshold); interactWithWidgets=cfs.retrieveValue<bool>("./interactWithWidgets",interactWithWidgets); /* Set tool class' factory pointer: */ MouseDialogNavigationTool::factory=this; }
ValuatorFlyNavigationToolFactory::ValuatorFlyNavigationToolFactory(ToolManager& toolManager) :ToolFactory("ValuatorFlyNavigationTool",toolManager), valuatorThreshold(0), flyDirection(Vector(0,1,0)), flyFactor(getDisplaySize()*Scalar(0.5)) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumValuators(0,1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); valuatorThreshold=cfs.retrieveValue<Scalar>("./valuatorThreshold",valuatorThreshold); flyDirection=cfs.retrieveValue<Vector>("./flyDirection",flyDirection); flyDirection.normalize(); flyFactor=cfs.retrieveValue<Scalar>("./flyFactor",flyFactor); /* Set tool class' factory pointer: */ ValuatorFlyNavigationTool::factory=this; }
SixDofWithScaleNavigationToolFactory::SixDofWithScaleNavigationToolFactory(ToolManager& toolManager) :ToolFactory("SixDofWithScaleNavigationTool",toolManager), scaleDeviceDistance(getInchFactor()*Scalar(6)), deviceScaleDirection(0,1,0), scaleFactor(getInchFactor()*Scalar(12)) { /* Initialize tool layout: */ layout.setNumDevices(2); layout.setNumButtons(0,1); layout.setNumButtons(1,0); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); scaleDeviceDistance=cfs.retrieveValue<Scalar>("./scaleDeviceDistance",scaleDeviceDistance); scaleDeviceDistance2=scaleDeviceDistance*scaleDeviceDistance; deviceScaleDirection=cfs.retrieveValue<Vector>("./deviceScaleDirection",deviceScaleDirection); scaleFactor=cfs.retrieveValue<Scalar>("./scaleFactor",scaleFactor); /* Set tool class' factory pointer: */ SixDofWithScaleNavigationTool::factory=this; }
ViewpointFileNavigationToolFactory::ViewpointFileNavigationToolFactory(ToolManager& toolManager) :ToolFactory("ViewpointFileNavigationTool",toolManager), viewpointFileName(""), viewpointSelectionHelper("",".views,.curve",openDirectory(".")), showGui(false), showKeyframes(true), pauseFileName("ViewpointFileNavigation.pauses"), autostart(false) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("NavigationTool"); toolFactory->addChildClass(this); addParentClass(toolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); viewpointFileName=cfs.retrieveString("./viewpointFileName",viewpointFileName); showGui=cfs.retrieveValue<bool>("./showGui",showGui); showKeyframes=cfs.retrieveValue<bool>("./showKeyframes",showKeyframes); pauseFileName=cfs.retrieveString("./pauseFileName",pauseFileName); autostart=cfs.retrieveValue<bool>("./autostart",autostart); /* Set tool class' factory pointer: */ ViewpointFileNavigationTool::factory=this; }
ValuatorTurnNavigationToolFactory::ValuatorTurnNavigationToolFactory(ToolManager& toolManager) :ToolFactory("ValuatorTurnNavigationTool",toolManager), valuatorThreshold(0.25), flyDirection(Vector(0,1,0)), flyFactor(getDisplaySize()*Scalar(0.5)), rotationAxis0(Vector(0,0,1)), rotationAxis1(Vector(1,0,0)), rotationCenter(Point::origin), rotationFactor(Scalar(90)) { /* Initialize tool layout: */ layout.setNumButtons(1); layout.setNumValuators(2); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); valuatorThreshold=cfs.retrieveValue<Scalar>("./valuatorThreshold",valuatorThreshold); flyDirection=cfs.retrieveValue<Vector>("./flyDirection",flyDirection); flyDirection.normalize(); flyFactor=cfs.retrieveValue<Scalar>("./flyFactor",flyFactor); rotationAxis0=cfs.retrieveValue<Vector>("./rotationAxis0",rotationAxis0); rotationAxis0.normalize(); rotationAxis1=cfs.retrieveValue<Vector>("./rotationAxis1",rotationAxis1); rotationAxis1.normalize(); rotationCenter=cfs.retrieveValue<Point>("./rotationCenter",rotationCenter); rotationFactor=Math::rad(cfs.retrieveValue<Scalar>("./rotationFactor",rotationFactor)); /* Set tool class' factory pointer: */ ValuatorTurnNavigationTool::factory=this; }
ButtonInputDeviceToolFactory::ButtonInputDeviceToolFactory(ToolManager& toolManager) :ToolFactory("ButtonInputDeviceTool",toolManager) { /* Initialize tool layout: */ layout.setNumButtons(8,true); layout.setNumValuators(0,true); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); /* Insert class into class hierarchy: */ ToolFactory* inputDeviceToolFactory=toolManager.loadClass("InputDeviceTool"); inputDeviceToolFactory->addChildClass(this); addParentClass(inputDeviceToolFactory); /* Initialize translation and rotation vectors: */ Scalar translateFactor=cfs.retrieveValue<Scalar>("./translateFactor",Scalar(4)*getInchFactor()); Scalar rotateFactor=Math::rad(cfs.retrieveValue<Scalar>("./rotateFactor",Scalar(60))); for(int i=0;i<6;++i) translations[i]=Vector::zero; for(int i=0;i<3;++i) { translations[2*i+0][i]=-translateFactor; translations[2*i+1][i]=translateFactor; } rotations[0]=Vector(0,0,-rotateFactor); rotations[1]=Vector(0,0,rotateFactor); rotations[2]=Vector(0,-rotateFactor,0); rotations[3]=Vector(0,rotateFactor,0); rotations[4]=Vector(rotateFactor,0,0); rotations[5]=Vector(-rotateFactor,0,0); /* Set tool class' factory pointer: */ ButtonInputDeviceTool::factory=this; }
ComeHitherNavigationToolFactory::ComeHitherNavigationToolFactory(ToolManager& toolManager) :ToolFactory("ComeHitherNavigationTool",toolManager), linearSnapThreshold(getDisplaySize()*Scalar(0.5)), angularSnapThreshold(Scalar(45)), maxLinearVelocity(getDisplaySize()*Scalar(1.5)), maxAngularVelocity(Scalar(90.0)) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); linearSnapThreshold=cfs.retrieveValue<Scalar>("./linearSnapThreshold",linearSnapThreshold); angularSnapThreshold=Math::rad(cfs.retrieveValue<Scalar>("./angularSnapThreshold",angularSnapThreshold)); maxLinearVelocity=cfs.retrieveValue<Scalar>("./maxLinearVelocity",maxLinearVelocity); maxAngularVelocity=Math::rad(cfs.retrieveValue<Scalar>("./maxAngularVelocity",maxAngularVelocity)); /* Set tool class' factory pointer: */ ComeHitherNavigationTool::factory=this; }
JediToolFactory::JediToolFactory(ToolManager& toolManager) :ToolFactory("JediTool",toolManager), lightsaberLength(Scalar(48)*getInchFactor()), lightsaberWidth(Scalar(6)*getInchFactor()), baseOffset(Scalar(3)*getInchFactor()), lightsaberImageFileName(std::string(VRUI_INTERNAL_CONFIG_SHAREDIR)+"/Textures/Lightsaber.png") { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("PointingTool"); toolFactory->addChildClass(this); addParentClass(toolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); lightsaberLength=cfs.retrieveValue<Scalar>("./lightsaberLength",lightsaberLength); lightsaberWidth=cfs.retrieveValue<Scalar>("./lightsaberWidth",lightsaberWidth); baseOffset=cfs.retrieveValue<Scalar>("./baseOffset",baseOffset); lightsaberImageFileName=cfs.retrieveString("./lightsaberImageFileName",lightsaberImageFileName); /* Set tool class' factory pointer: */ JediTool::factory=this; }
MenuToolFactory::MenuToolFactory(ToolManager& toolManager) :ToolFactory("MenuTool",toolManager) { /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("UserInterfaceTool"); toolFactory->addChildClass(this); addParentClass(toolFactory); }
DraggingToolFactory::DraggingToolFactory(ToolManager& toolManager) :ToolFactory("DraggingTool",toolManager) { #if 0 /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("Tool"); toolFactory->addChildClass(this); addParentClass(toolFactory); #endif }
MouseNavigationToolFactory::MouseNavigationToolFactory(ToolManager& toolManager) :ToolFactory("MouseNavigationTool",toolManager), rotatePlaneOffset(getInchFactor()*Scalar(12)), rotateFactor(getInchFactor()*Scalar(12)), invertDolly(false), screenDollyingDirection(0,1,0), screenScalingDirection(0,1,0), dollyFactor(getInchFactor()*Scalar(12)), scaleFactor(getInchFactor()*Scalar(12)), wheelDollyFactor(getInchFactor()*Scalar(-12)), wheelScaleFactor(Scalar(0.5)), spinThreshold(Scalar(0)), showScreenCenter(false), interactWithWidgets(true), showMouseCursor(false), mouseCursorSize(Scalar(0.5),Scalar(0.5),Scalar(0.0)), mouseCursorHotspot(Scalar(0.0),Scalar(1.0),Scalar(0.0)), mouseCursorImageFileName(DEFAULTMOUSECURSORIMAGEFILENAME), mouseCursorNominalSize(24) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,3); layout.setNumValuators(0,1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); rotatePlaneOffset=cfs.retrieveValue<Scalar>("./rotatePlaneOffset",rotatePlaneOffset); rotateFactor=cfs.retrieveValue<Scalar>("./rotateFactor",rotateFactor); invertDolly=cfs.retrieveValue<bool>("./invertDolly",invertDolly); screenDollyingDirection=cfs.retrieveValue<Vector>("./screenDollyingDirection",screenDollyingDirection); screenScalingDirection=cfs.retrieveValue<Vector>("./screenScalingDirection",screenScalingDirection); dollyFactor=cfs.retrieveValue<Scalar>("./dollyFactor",dollyFactor); scaleFactor=cfs.retrieveValue<Scalar>("./scaleFactor",scaleFactor); wheelDollyFactor=cfs.retrieveValue<Scalar>("./wheelDollyFactor",wheelDollyFactor); wheelScaleFactor=cfs.retrieveValue<Scalar>("./wheelScaleFactor",wheelScaleFactor); spinThreshold=cfs.retrieveValue<Scalar>("./spinThreshold",spinThreshold); showScreenCenter=cfs.retrieveValue<bool>("./showScreenCenter",showScreenCenter); interactWithWidgets=cfs.retrieveValue<bool>("./interactWithWidgets",interactWithWidgets); showMouseCursor=cfs.retrieveValue<bool>("./showMouseCursor",showMouseCursor); mouseCursorSize=cfs.retrieveValue<Size>("./mouseCursorSize",mouseCursorSize); mouseCursorHotspot=cfs.retrieveValue<Vector>("./mouseCursorHotspot",mouseCursorHotspot); mouseCursorImageFileName=cfs.retrieveString("./mouseCursorImageFileName",mouseCursorImageFileName); mouseCursorNominalSize=cfs.retrieveValue<unsigned int>("./mouseCursorNominalSize",mouseCursorNominalSize); /* Set tool class' factory pointer: */ MouseNavigationTool::factory=this; }
KinectPlayerFactory::KinectPlayerFactory(Vrui::VisletManager& visletManager) :Vrui::VisletFactory("KinectPlayer",visletManager) { #if 0 /* Insert class into class hierarchy: */ Vrui::VisletFactory* visletFactory=visletManager.loadClass("Vislet"); visletFactory->addChildClass(this); addParentClass(visletFactory); #endif /* Load class settings: */ Misc::ConfigurationFileSection cfs=visletManager.getVisletClassSection(getClassName()); std::string defaultSaveFileNamePrefix=cfs.retrieveString("./saveFileNamePrefix","."); std::vector<std::string> kinectDevices=cfs.retrieveValue<std::vector<std::string> >("./kinectDevices",std::vector<std::string>()); for(std::vector<std::string>::iterator kdIt=kinectDevices.begin();kdIt!=kinectDevices.end();++kdIt) { /* Go to the Kinect device's configuration file section: */ Misc::ConfigurationFileSection kds=cfs.getSection(kdIt->c_str()); KinectConfig config; /* Read the recorded camera's serial number: */ config.deviceSerialNumber=kds.retrieveString("./serialNumber"); /* Read the save file name prefix: */ config.saveFileNamePrefix=kds.retrieveString("./saveFileNamePrefix",defaultSaveFileNamePrefix); /* Store the configuration structure: */ kinectConfigs.push_back(config); } std::vector<std::string> soundDevices=cfs.retrieveValue<std::vector<std::string> >("./soundDevices",std::vector<std::string>()); for(std::vector<std::string>::iterator sdIt=soundDevices.begin();sdIt!=soundDevices.end();++sdIt) { /* Go to the sound device's configuration file section: */ Misc::ConfigurationFileSection sds=cfs.getSection(sdIt->c_str()); SoundConfig config; /* Read node index: */ config.nodeIndex=sds.retrieveValue<int>("./nodeIndex",0); /* Read the sound file name: */ config.soundFileName=sds.retrieveString("./soundFileName"); /* Store the configuration structure: */ soundConfigs.push_back(config); } /* Set tool class' factory pointer: */ KinectPlayer::factory=this; }
SceneGraphViewerFactory::SceneGraphViewerFactory(VisletManager& visletManager) :VisletFactory("SceneGraphViewer",visletManager) { #if 0 /* Insert class into class hierarchy: */ VisletFactory* visletFactory=visletManager.loadClass("Vislet"); visletFactory->addChildClass(this); addParentClass(visletFactory); #endif /* Set tool class' factory pointer: */ SceneGraphViewer::factory=this; }
TransformToolFactory::TransformToolFactory(ToolManager& toolManager) :ToolFactory("TransformTool",toolManager) { #if 0 /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("Tool"); toolFactory->addChildClass(this); addParentClass(toolFactory); #endif /* Set tool class' factory pointer: */ TransformTool::factory=this; }
ValuatorToButtonToolFactory::ValuatorToButtonToolFactory(ToolManager& toolManager) :ToolFactory("ValuatorToButtonTool",toolManager) { /* Insert class into class hierarchy: */ TransformToolFactory* transformToolFactory=dynamic_cast<TransformToolFactory*>(toolManager.loadClass("TransformTool")); transformToolFactory->addChildClass(this); addParentClass(transformToolFactory); /* Initialize tool layout: */ layout.setNumValuators(1,true); /* Set tool class' factory pointer: */ ValuatorToButtonTool::factory=this; }
WidgetToolFactory::WidgetToolFactory(ToolManager& toolManager) :ToolFactory("WidgetTool",toolManager) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* toolFactory=toolManager.loadClass("UserInterfaceTool"); toolFactory->addChildClass(this); addParentClass(toolFactory); /* Set tool class' factory pointer: */ WidgetTool::factory=this; }
SixDofNavigationToolFactory::SixDofNavigationToolFactory(ToolManager& toolManager) :ToolFactory("SixDofNavigationTool",toolManager) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Set tool class' factory pointer: */ SixDofNavigationTool::factory=this; }
PanelMenuToolFactory::PanelMenuToolFactory(ToolManager& toolManager) :ToolFactory("PanelMenuTool",toolManager) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,0); /* Insert class into class hierarchy: */ ToolFactory* menuToolFactory=toolManager.loadClass("MenuTool"); menuToolFactory->addChildClass(this); addParentClass(menuToolFactory); /* Set tool class' factory pointer: */ PanelMenuTool::factory=this; }
EarthquakeToolFactory::EarthquakeToolFactory(Vrui::ToolManager& toolManager,const std::vector<EarthquakeSet*>& sEarthquakeSets) :Vrui::ToolFactory("EarthquakeTool",toolManager), earthquakeSets(sEarthquakeSets) { /* Insert class into class hierarchy: */ Vrui::TransformToolFactory* transformToolFactory=dynamic_cast<Vrui::TransformToolFactory*>(toolManager.loadClass("TransformTool")); transformToolFactory->addChildClass(this); addParentClass(transformToolFactory); /* Initialize tool layout: */ layout.setNumButtons(0,true); layout.setNumValuators(0,true); /* Set the custom tool class' factory pointer: */ EarthquakeTool::factory=this; }
SixAxisSurfaceNavigationToolFactory::SixAxisSurfaceNavigationToolFactory(ToolManager& toolManager) :ToolFactory("SixAxisSurfaceNavigationTool",toolManager), canRoll(true), bankTurns(false),levelSpeed(5), canFly(true), probeSize(getDisplaySize()), maxClimb(getDisplaySize()), fixAzimuth(false), drawHud(true),hudColor(0.0f,1.0f,0.0f),hudRadius(float(getFrontplaneDist()*1.25f)),hudFontSize(float(getUiSize())*1.5f) { /* Initialize tool layout: */ layout.setNumValuators(6); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); Vector trans; for(int i=0;i<3;++i) trans[i]=getDisplaySize(); trans=cfs.retrieveValue<Vector>("./translateFactors",trans); for(int i=0;i<3;++i) translateFactors[i]=trans[i]; Vector rot=cfs.retrieveValue<Vector>("./rotateFactors",Vector(180,180,180)); for(int i=0;i<3;++i) rotateFactors[i]=Math::rad(rot[i]); canRoll=cfs.retrieveValue<bool>("./canRoll",canRoll); bankTurns=cfs.retrieveValue<bool>("./bankTurns",bankTurns); levelSpeed=cfs.retrieveValue<Scalar>("./levelSpeed",levelSpeed); if(levelSpeed<Scalar(0)) levelSpeed=Scalar(0); canFly=cfs.retrieveValue<bool>("./canFly",canFly); probeSize=cfs.retrieveValue<Scalar>("./probeSize",probeSize); maxClimb=cfs.retrieveValue<Scalar>("./maxClimb",maxClimb); fixAzimuth=cfs.retrieveValue<bool>("./fixAzimuth",fixAzimuth); drawHud=cfs.retrieveValue<bool>("./drawHud",drawHud); hudColor=cfs.retrieveValue<Color>("./hudColor",hudColor); hudRadius=cfs.retrieveValue<float>("./hudRadius",hudRadius); hudFontSize=cfs.retrieveValue<float>("./hudFontSize",hudFontSize); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("SurfaceNavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Set tool class' factory pointer: */ SixAxisSurfaceNavigationTool::factory=this; }
SixAxisTransformToolFactory::SixAxisTransformToolFactory(ToolManager& toolManager) :ToolFactory("SixAxisTransformTool",toolManager) { /* Initialize tool layout: */ layout.setNumButtons(1,true); layout.setNumValuators(6,true); /* Insert class into class hierarchy: */ ToolFactory* transformToolFactory=toolManager.loadClass("TransformTool"); transformToolFactory->addChildClass(this); addParentClass(transformToolFactory); /* Load class settings: */ config.load(toolManager.getToolClassSection(getClassName())); /* Set tool class' factory pointer: */ SixAxisTransformTool::factory=this; }
SixAxisNavigationToolFactory::SixAxisNavigationToolFactory(ToolManager& toolManager) :ToolFactory("SixAxisNavigationTool",toolManager) { /* Initialize tool layout: */ layout.setNumValuators(7); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs(toolManager.getToolClassSection(getClassName())); config.load(cfs); /* Set tool class' factory pointer: */ SixAxisNavigationTool::factory=this; }
VruiCustomToolDemo::MyToolFactory::MyToolFactory(Vrui::ToolManager& toolManager,VruiCustomToolDemo* sApplication) :Vrui::ToolFactory("MyTool",toolManager), application(sApplication) { /* Initialize the input device layout of the custom tool class: */ layout.setNumDevices(1); // Custom tools require one input device layout.setNumButtons(0,2); // Custom tools require two buttons on the input device #if 0 // Tool classes directly derived from Vrui::Tool must not do this /* Insert the custom tool class into the tool hierarchy: */ Vrui::ToolFactory* toolFactory=toolManager.loadClass("Tool"); toolFactory->addChildClass(this); addParentClass(toolFactory); #endif /* Set the custom tool class' factory pointer: */ MyTool::factory=this; }
MultiDeviceNavigationToolFactory::MultiDeviceNavigationToolFactory(ToolManager& toolManager) :ToolFactory("MultiDeviceNavigationTool",toolManager) { /* Initialize tool layout: */ layout.setNumButtons(1,true); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); configuration.read(cfs); /* Set tool class' factory pointer: */ MultiDeviceNavigationTool::factory=this; }
WalkNavigationToolFactory::WalkNavigationToolFactory(ToolManager& toolManager) :ToolFactory("WalkNavigationTool",toolManager), floorPlane(getFloorPlane()), centerOnActivation(false), centerPoint(getDisplayCenter()), moveSpeed(getDisplaySize()), innerRadius(getDisplaySize()*Scalar(0.5)),outerRadius(getDisplaySize()*Scalar(0.75)), centerViewDirection(getForwardDirection()), rotateSpeed(Math::rad(Scalar(120))), innerAngle(Math::rad(Scalar(30))),outerAngle(Math::rad(Scalar(120))), drawMovementCircles(true), movementCircleColor(0.0f,1.0f,0.0f) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); floorPlane=cfs.retrieveValue<Plane>("./floorPlane",floorPlane); floorPlane.normalize(); centerOnActivation=cfs.retrieveValue<bool>("./centerOnActivation",centerOnActivation); centerPoint=cfs.retrieveValue<Point>("./centerPoint",centerPoint); centerPoint=floorPlane.project(centerPoint); moveSpeed=cfs.retrieveValue<Scalar>("./moveSpeed",moveSpeed); innerRadius=cfs.retrieveValue<Scalar>("./innerRadius",innerRadius); outerRadius=cfs.retrieveValue<Scalar>("./outerRadius",outerRadius); centerViewDirection=cfs.retrieveValue<Vector>("./centerViewDirection",centerViewDirection); centerViewDirection=floorPlane.project(centerViewDirection); centerViewDirection.normalize(); rotateSpeed=Math::rad(cfs.retrieveValue<Scalar>("./rotateSpeed",Math::deg(rotateSpeed))); innerAngle=Math::rad(cfs.retrieveValue<Scalar>("./innerAngle",Math::deg(innerAngle))); outerAngle=Math::rad(cfs.retrieveValue<Scalar>("./outerAngle",Math::deg(outerAngle))); drawMovementCircles=cfs.retrieveValue<bool>("./drawMovementCircles",drawMovementCircles); movementCircleColor=cfs.retrieveValue<Color>("./movementCircleColor",movementCircleColor); /* Set tool class' factory pointer: */ WalkNavigationTool::factory=this; }
RayScreenMenuToolFactory::RayScreenMenuToolFactory(ToolManager& toolManager) :ToolFactory("RayScreenMenuTool",toolManager), interactWithWidgets(false) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* menuToolFactory=toolManager.loadClass("MenuTool"); menuToolFactory->addChildClass(this); addParentClass(menuToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); interactWithWidgets=cfs.retrieveValue<bool>("./interactWithWidgets",interactWithWidgets); /* Set tool class' factory pointer: */ RayScreenMenuTool::factory=this; }
PlaneSnapInputDeviceToolFactory::PlaneSnapInputDeviceToolFactory(ToolManager& toolManager) :ToolFactory("PlaneSnapInputDeviceTool",toolManager), markerSize(getUiSize()) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* inputDeviceToolFactory=toolManager.loadClass("InputDeviceTool"); inputDeviceToolFactory->addChildClass(this); addParentClass(inputDeviceToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); markerSize=cfs.retrieveValue<Scalar>("./markerSize",markerSize); /* Set tool class' factory pointer: */ PlaneSnapInputDeviceTool::factory=this; }
TrackballNavigationToolFactory::TrackballNavigationToolFactory(ToolManager& toolManager) :ToolFactory("TrackballNavigationTool",toolManager), rotateFactor(1) { /* Initialize tool layout: */ layout.setNumButtons(1); /* Insert class into class hierarchy: */ ToolFactory* navigationToolFactory=toolManager.loadClass("NavigationTool"); navigationToolFactory->addChildClass(this); addParentClass(navigationToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); rotateFactor=cfs.retrieveValue<Scalar>("./rotateFactor",rotateFactor); /* Set tool class' factory pointer: */ TrackballNavigationTool::factory=this; }
RayInputDeviceToolFactory::RayInputDeviceToolFactory(ToolManager& toolManager) :ToolFactory("RayInputDeviceTool",toolManager), rotateFactor(getInchFactor()*Scalar(3)) { /* Initialize tool layout: */ layout.setNumDevices(1); layout.setNumButtons(0,1); /* Insert class into class hierarchy: */ ToolFactory* inputDeviceToolFactory=toolManager.loadClass("InputDeviceTool"); inputDeviceToolFactory->addChildClass(this); addParentClass(inputDeviceToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); rotateFactor=cfs.retrieveValue<Scalar>("./rotateFactor",rotateFactor); /* Set tool class' factory pointer: */ RayInputDeviceTool::factory=this; }
RevolverToolFactory::RevolverToolFactory(ToolManager& toolManager) :ToolFactory("RevolverTool",toolManager), numChambers(6) { /* Insert class into class hierarchy: */ TransformToolFactory* transformToolFactory=dynamic_cast<TransformToolFactory*>(toolManager.loadClass("TransformTool")); transformToolFactory->addChildClass(this); addParentClass(transformToolFactory); /* Load class settings: */ Misc::ConfigurationFileSection cfs=toolManager.getToolClassSection(getClassName()); numChambers=cfs.retrieveValue<int>("./numChambers",numChambers); /* Initialize tool layout: */ layout.setNumButtons(1,true); layout.setNumValuators(0,true); /* Set tool class' factory pointer: */ RevolverTool::factory=this; }