当前位置: 首页>>代码示例>>C++>>正文


C++ ToolManager::loadClass方法代码示例

本文整理汇总了C++中ToolManager::loadClass方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolManager::loadClass方法的具体用法?C++ ToolManager::loadClass怎么用?C++ ToolManager::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ToolManager的用法示例。


在下文中一共展示了ToolManager::loadClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: valuatorThreshold

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;
	}
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:35,代码来源:ValuatorTurnNavigationTool.cpp

示例2:

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;
	}
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:35,代码来源:ButtonInputDeviceTool.cpp

示例3: rotatePlaneOffset

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;
	}
开发者ID:VisualIdeation,项目名称:Vrui-2.2-003,代码行数:33,代码来源:MouseDialogNavigationTool.cpp

示例4: lightsaberLength

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;
	}
开发者ID:KeckCAVES,项目名称:Vrui,代码行数:25,代码来源:JediTool.cpp

示例5: linearSnapThreshold

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;
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:26,代码来源:ComeHitherNavigationTool.cpp

示例6: scaleDeviceDistance

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;
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:26,代码来源:SixDofWithScaleNavigationTool.cpp

示例7: valuatorThreshold

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;
}
开发者ID:jrevote,项目名称:3DA-Vrui,代码行数:25,代码来源:ValuatorFlyNavigationTool.cpp

示例8:

MenuToolFactory::MenuToolFactory(ToolManager& toolManager)
	:ToolFactory("MenuTool",toolManager)
	{
	/* Insert class into class hierarchy: */
	ToolFactory* toolFactory=toolManager.loadClass("UserInterfaceTool");
	toolFactory->addChildClass(this);
	addParentClass(toolFactory);
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:8,代码来源:MenuTool.cpp

示例9:

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
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:10,代码来源:DraggingTool.cpp

示例10: rotatePlaneOffset

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;
}
开发者ID:jrevote,项目名称:3DA-Vrui,代码行数:53,代码来源:MouseNavigationTool.cpp

示例11: addParentClass

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;
}
开发者ID:VisualIdeation,项目名称:Vrui-2.2-003,代码行数:13,代码来源:TransformTool.cpp

示例12:

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;
	}
开发者ID:KeckCAVES,项目名称:Vrui,代码行数:14,代码来源:WidgetTool.cpp

示例13:

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;
	}
开发者ID:KeckCAVES,项目名称:Vrui,代码行数:14,代码来源:ValuatorToButtonTool.cpp

示例14:

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;
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:15,代码来源:PanelMenuTool.cpp

示例15:

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;
	}
开发者ID:VisualIdeation,项目名称:Vrui,代码行数:15,代码来源:SixDofNavigationTool.cpp


注:本文中的ToolManager::loadClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。