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


C++ ParamBlockDesc2::GetInt方法代码示例

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


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

示例1: proc

int EllipseObjCreateCallBack::proc(ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat ) 
{
	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Invalid viewport!"));
		return FALSE;
	}

	Point3 d;
#ifdef _3D_CREATE
	DWORD snapdim = SNAP_IN_3D;
#else
	DWORD snapdim = SNAP_IN_PLANE;
#endif

	if (msg == MOUSE_FREEMOVE)
	{
#ifdef _OSNAP
		vpt->SnapPreview(m,m,NULL, snapdim);
#endif
	}
	if (msg==MOUSE_POINT||msg==MOUSE_MOVE) 
	{
		switch(point) 
		{
		case 0:
			sp0 = m;
			ob->suspendSnap = TRUE;

			// Get the creation method
			createType = theEllispeCreateBlock.GetInt(PB_CREATEMETHOD);
			p0 = vpt->SnapPoint(m,m,NULL,snapdim);
			p1 = p0 + Point3(.01,.01,.0);

			ob->GetParamBlockByID(ellipse_params)->SetValue(PB_LENGTH,0,0.f);
			ob->GetParamBlockByID(ellipse_params)->SetValue(PB_WIDTH,0,0.f);	
			ob->GetParamBlockByID(ellipse_params)->SetValue(PB_THICKNESS, 0, 0.f);

			if(createType == CREATE_EDGE)
				mat.SetTrans(float(.5)*(p0+p1));
			else
				mat.SetTrans(p0);
			break;
		case 1: 
			{ 
				p1 = vpt->SnapPoint(m,m,NULL,snapdim);
				p1.z = p0.z; 
				d = p1-p0;
				float w = float(fabs(d.x));
				float l = float(fabs(d.y));
				if(flags & MOUSE_CTRL) 
				{
					if(createType == CREATE_EDGE) 
					{
						float ysign = (d.y < 0.0f) ? -1.0f : 1.0f;
						mat.SetTrans(float(.5)*(p0+Point3(p1.x,p0.y+ysign*w,0.0f)));
					}
					else 
					{
						mat.SetTrans(p0);
						w = w * 2.0f;
					}
					ob->GetParamBlockByID(ellipse_params)->SetValue(PB_LENGTH,0,w);
					ob->GetParamBlockByID(ellipse_params)->SetValue(PB_WIDTH,0,w);
				}
				else 
				{
					if(createType == CREATE_EDGE)
					{
						mat.SetTrans(float(.5)*(p0+p1));
					}
					else 
					{
						mat.SetTrans(p0);
						w = w * 2.0f;
						l = l * 2.0f;
					}
					ob->GetParamBlockByID(ellipse_params)->SetValue(PB_WIDTH,0,w);
					ob->GetParamBlockByID(ellipse_params)->SetValue(PB_LENGTH,0,l);
				}

				theEllipseParamBlock.InvalidateUI();
				if (msg == MOUSE_POINT && (Length(m-sp0)<3 || Length(p1-p0)<0.1f)) 
				{
					ob->suspendSnap = FALSE;
					return CREATE_ABORT;
				}

				break;
			}
		case 2 :
			{
				ob->GetParamBlockByID(ellipse_params)->GetValue(PB_OUTLINE, 0, EllipseObject::msBuild_outline, ob->ivalid);
				if(EllipseObject::msBuild_outline)
				{
					p2 = vpt->SnapPoint(m,m,NULL,snapdim);
					float thickness = Length(p2-p0) - Length(p1-p0);
					ob->GetParamBlockByID(ellipse_params)->SetValue(PB_THICKNESS,0,thickness);

//.........这里部分代码省略.........
开发者ID:artemeliy,项目名称:inf4715,代码行数:101,代码来源:ellipse.cpp


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