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


C++ GraphicsWindow::getRndMode方法代码示例

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


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

示例1: Display

int TriPatchObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) {

	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Invalid viewport!"));
		return FALSE;
	}

	Matrix3 tm;
	GraphicsWindow *gw = vpt->getGW();
	gw->setTransform(inode->GetObjectTM(t));
	UpdatePatchMesh(t);

	if(!MaxSDK::Graphics::IsRetainedModeEnabled())
	{
		if(!(gw->getRndMode() & GW_BOX_MODE)) {
			PrepareMesh(t);
			Mesh& mesh = patch.GetMesh();
			if(mesh.getNumVerts()) {
				mesh.render( gw, inode->Mtls(),
					(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
					COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
			}
		}
	}

	patch.render( gw, inode->Mtls(),
		(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
		COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
	return(0);
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:32,代码来源:tripatch.cpp

示例2: Display

int TriPatchObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) {
	Matrix3 tm;
	GraphicsWindow *gw = vpt->getGW();
	gw->setTransform(inode->GetObjectTM(t));
	UpdatePatchMesh(t);
	if(!(gw->getRndMode() & GW_BOX_MODE)) {
		PrepareMesh(t);
		Mesh& mesh = patch.GetMesh();
		if(mesh.getNumVerts()) {
			mesh.render( gw, inode->Mtls(),
				(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
				COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
			}
		}
	patch.render( gw, inode->Mtls(),
		(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
		COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
	return(0);
	}
开发者ID:DimondTheCat,项目名称:xray,代码行数:19,代码来源:tripatch.cpp

示例3: Array

Value*
getRndMode_cf(Value** arg_list, int count)
{
	check_arg_count(getRndMode, 0, count);
	def_render_types();
	one_typed_value_local(Array* result);
	GraphicsWindow	*gw		= MAXScript_interface->GetActiveViewExp().getGW();
	
	if (MaxSDK::Graphics::IsRetainedModeEnabled() && gw->querySupport(GW_SPT_NUM_LIGHTS) == 0)
	{
		return &undefined;
	}

	DWORD			mode	= gw->getRndMode();

	vl.result = new Array(3);
	for (int i=0; i < elements(renderTypes); i++)
		if ((renderTypes[i].id) & mode) 
			vl.result->append(renderTypes[i].val);		
	return_value (vl.result); // LAM - 5/18/01 - was return vl.result
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:21,代码来源:GraphicsWindow.cpp

示例4: Display

int TriObject::Display(TimeValue t, INode *inode, ViewExp* vpt, int flags) {

	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Invalid viewport!"));
		return FALSE;
	}

	float *vsw = NULL;
	DWORD oldRndLimits, newRndLimits;
	Tab<VertColor> vertexSelColors;
	Tab<TVFace> vertexSelFaces;

	Matrix3 tm;
	GraphicsWindow *gw = vpt->getGW();
	gw->setTransform(inode->GetObjectTM(t));

	newRndLimits = oldRndLimits = gw->getRndLimits();

	// CAL-11/16/01: Use soft selection colors when soft selection is turned on in sub-object mode.
	// The condition is satisfied if the display of vertex/edge/face/poly is requested and
	// the vertex selection weights are set.
	// CAL-12/02/01: Add one more checking to the condition to check if the display of soft
	// selection using wireframe or vertex color shading is requested.
	// CAL-11/16/01: (TODO) To imporvement the performance of this function,
	// vertexSelColors & vertexSelFaces tables can be cached (in Mesh) and used as long as
	// the vertex selection weights are not changed.
	bool dspSoftSelVert = ((gw->getRndMode()&GW_VERT_TICKS) ||
						   ((mesh.dispFlags&DISP_VERTTICKS) && (flags&DISP_SHOWSUBOBJECT))) &&
						  (mesh.dispFlags&DISP_SELVERTS);
	bool dspSoftSelEdFc = ((mesh.dispFlags&DISP_SELEDGES) || (mesh.dispFlags&DISP_SELFACES) ||
						   (mesh.dispFlags&DISP_SELPOLYS)) && (flags&DISP_SHOWSUBOBJECT);
	bool dspWireSoftSel = (oldRndLimits&GW_WIREFRAME) ||
						  ((oldRndLimits&GW_COLOR_VERTS) && (inode->GetVertexColorType() == nvct_soft_select));
	if ((dspSoftSelVert || dspSoftSelEdFc) && dspWireSoftSel &&
		(vsw = mesh.getVSelectionWeights())) {

		Point3 clr = GetUIColor(COLOR_VERT_TICKS);
		
		vertexSelColors.SetCount(mesh.getNumVerts());
		vertexSelFaces.SetCount(mesh.getNumFaces());

		// Create the array of colors, one per vertex:
		for (int i=0; i<mesh.getNumVerts(); i++) {
			// (Note we may want a different color - this gives the appropriate vertex-tick
			// color, which we may not want to use on faces.  Fades from blue to red.)
			vertexSelColors[i] = (vsw[i]) ? SoftSelectionColor(vsw[i]) : clr;
		}

		// Copy over the face topology exactly to the map face topology:
		for (i=0; i<mesh.getNumFaces(); i++) {
			DWORD *pv = mesh.faces[i].v;
			vertexSelFaces[i].setTVerts(pv[0], pv[1], pv[2]);
		}

		// CAL-05/21/02: make sure there's data before accessing it.
		// Set the mesh to use these colors:
		mesh.setVCDisplayData (MESH_USE_EXT_CVARRAY,
			(vertexSelColors.Count() > 0) ? vertexSelColors.Addr(0) : NULL,
			(vertexSelFaces.Count() > 0) ? vertexSelFaces.Addr(0) : NULL);

		// Turn on vertex color mode
		if (oldRndLimits&GW_WIREFRAME) {
			newRndLimits |= GW_COLOR_VERTS;				// turn on vertex colors
			newRndLimits &= ~GW_SHADE_CVERTS;			// turn off vertex color shading
			newRndLimits |= GW_ILLUM;					// turn on lit wire frame
			gw->setRndLimits(newRndLimits);
		}

	} else {
		switch (inode->GetVertexColorType()) {
		case nvct_color:
			if (mesh.curVCChan == 0) break;
			mesh.setVCDisplayData (0);
			break;
		case nvct_illumination:
			if (mesh.curVCChan == MAP_SHADING) break;
			mesh.setVCDisplayData (MAP_SHADING);
			break;
		case nvct_alpha:
			if (mesh.curVCChan == MAP_ALPHA) break;
			mesh.setVCDisplayData (MAP_ALPHA);
			break;
		//case nvct_color_plus_illum:
			// if (mesh.curVCChan == MESH_USE_EXT_CVARRAY) break;
			// Where do I cache the arrays I'll need to create from the color and illum arrays?
			// break;
		// CAL-06/15/03: add a new option to view map channel as vertex color. (FID #1926)
		case nvct_map_channel:
			if (mesh.curVCChan == inode->GetVertexColorMapChannel()) break;
			mesh.setVCDisplayData (inode->GetVertexColorMapChannel());
			break;
		case nvct_soft_select:
			// Turn off vertex color if soft selection is not on.
			if (oldRndLimits&GW_COLOR_VERTS) {
				newRndLimits &= ~GW_COLOR_VERTS;
				gw->setRndLimits(newRndLimits);
			}
			break;
//.........这里部分代码省略.........
开发者ID:artemeliy,项目名称:inf4715,代码行数:101,代码来源:triobj.cpp


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