⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rendermolecule.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                // state could have been changed. Example,                // application could have detached an appearance,                // made changes to the appearance state, and then                // reattached the appearance. In this case, the                 // changes would not have reflected to the RenderMolecule                if (numEditingRenderAtoms == 0) {		    if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			renderBin.rmUpdateList.add(this);		    }		    soleUserCompDirty |= ALL_DIRTY_BITS;		}		return true;	    }	    else {		return false;	    }	    	}	// Assign the cloned value as the original value	// Either a changedFrequent or a null case	// and the incoming one is not equal or null	// then return;		// This check also handles null == null case	if (definingPolygonAttributes != null) {	    if ((this.definingPolygonAttributes.changedFrequent != 0) ||		(polygonAttributes !=null && polygonAttributes.changedFrequent != 0))		if (definingPolygonAttributes == polygonAttributes) {		    if (definingPolygonAttributes.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= POLYGONATTRS_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingPolygonAttributes.equivalent(polygonAttributes)) {		return false;	    }	}	else if (polygonAttributes != null) {	    return false;	}	if (definingLineAttributes != null) {	    if ((this.definingLineAttributes.changedFrequent != 0) ||		(lineAttributes !=null && lineAttributes.changedFrequent != 0))		if (definingLineAttributes == lineAttributes) {		    if (definingLineAttributes.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= LINEATTRS_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingLineAttributes.equivalent(lineAttributes)) {		return false;	    }	}	else if (lineAttributes != null) {	    return false;	}		if (definingPointAttributes != null) {	    if ((this.definingPointAttributes.changedFrequent != 0) ||		(pointAttributes !=null && pointAttributes.changedFrequent != 0))		if (definingPointAttributes == pointAttributes) {		    if (definingPointAttributes.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= POINTATTRS_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingPointAttributes.equivalent(pointAttributes)) {		return false;	    }	}	else if (pointAttributes != null) {	    return false;	}		if (definingMaterial != null) {	    if ((this.definingMaterial.changedFrequent != 0) ||		(material !=null && material.changedFrequent != 0))		if (definingMaterial == material) {		    if (definingMaterial.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= MATERIAL_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingMaterial.equivalent(material)) {		return false;	    }	}	else if (material != null) {	    return false;	}	if (definingColoringAttributes != null) {	    if ((this.definingColoringAttributes.changedFrequent != 0) ||		(coloringAttributes !=null && coloringAttributes.changedFrequent != 0))		if (definingColoringAttributes == coloringAttributes) {		    if (definingColoringAttributes.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= COLORINGATTRS_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingColoringAttributes.equivalent(coloringAttributes)) {		return false;	    }	}	else if (coloringAttributes != null) {	    return false;	}	// if the definingTransparency is a non cloned values and the incoming	// one is equivalent, then check if the component is dirty	// this happens when all the RAs from this RM have been removed	// but new ones are not added yet (rbin visibility) not run yet	// and when there is a change in nc based on the new RA, we wil;	// miss the change, doing this check will catch the change durin	// new RAs insertRenderAtom	if (definingTransparency != null) {	    if ((this.definingTransparency.changedFrequent != 0) ||		(transparency !=null && transparency.changedFrequent != 0))		if (definingTransparency == transparency) {		    if (definingTransparency.compChanged != 0) {			if ((soleUserCompDirty& ALL_DIRTY_BITS) == 0 ) {			    renderBin.rmUpdateList.add(this);			}			soleUserCompDirty |= TRANSPARENCY_DIRTY;		    }		}		else {		    return false;		}	    else if (!definingTransparency.equivalent(transparency)) {		return false;	    }	}	else if (transparency != null) {	    return false;	}	return (true);    }    public void updateRemoveRenderAtoms() {	int i;	RenderAtom r;	RenderAtomListInfo rinfo;	// Check if this renderMolecule was created and destroyed this frame.	// so, no display list was created	if (numRenderAtoms == 0 && removeRAs == null && addRAs == null) {	    textureBin.removeRenderMolecule(this);	    return;	}		while (removeRAs != null) {	    r = (RenderAtom)removeRAs;	    r.removed = null;	    numRenderAtoms--;	    // Loop thru all geometries in the renderAtom, they could	    // potentially be in different buckets in the rendermoleulce	    for (int index = 0; index < r.rListInfo.length; index++) {		rinfo = r.rListInfo[index];		// Don't remove  null geo		if (rinfo.geometry() == null)		    continue;				if ((rinfo.groupType & RenderAtom.PRIMARY) != 0) {		    primaryChanged = true;		    if (rinfo.prev == null) { // At the head of the list			primaryRenderAtomList = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = null;			}		    } else { // In the middle or at the end.			rinfo.prev.next = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = rinfo.prev;			}		    }		    // If the molecule type is Raster, then add it to the lock list		    if (primaryMoleculeType == RASTER) {			RasterRetained geo = (RasterRetained)rinfo.geometry();			renderBin.removeGeometryFromLockList(geo);			if (geo.image != null) 				renderBin.removeNodeComponent(geo.image);		    }		    else if ((rinfo.groupType & RenderAtom.SEPARATE_DLIST_PER_RINFO) != 0) {			if (!rinfo.renderAtom.inRenderBin()) {			    renderBin.removeDlistPerRinfo.add(rinfo);			}		    }		} 		else if ((rinfo.groupType & RenderAtom.SEPARATE_DLIST_PER_GEO) != 0) {		    if (rinfo.prev == null) { // At the head of the list			separateDlistRenderAtomList = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = null;			}		    } else { // In the middle or at the end.			rinfo.prev.next = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = rinfo.prev;			}		    }		    renderBin.removeGeometryDlist(rinfo);		    		}		else {		    if (rinfo.prev == null) { // At the head of the list			vertexArrayRenderAtomList = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = null;			}		    } else { // In the middle or at the end.			rinfo.prev.next = rinfo.next;			if (rinfo.next != null) {			    rinfo.next.prev = rinfo.prev;			}		    }		    // For indexed geometry there is no need to lock since		    // the mirror is changed only when the renderer is not		    // running		    // For indexed geometry, if use_coord is set, then either we		    // are using the index geometry as is or we will be unindexifying		    // on the fly, so its better to lock		    GeometryArrayRetained geo = (GeometryArrayRetained)rinfo.geometry();		    if (!(geo instanceof IndexedGeometryArrayRetained) ||			((geo.vertexFormat & GeometryArray.USE_COORD_INDEX_ONLY) != 0)) {			renderBin.removeGeometryFromLockList(geo);		    }		}		rinfo.prev = null;		rinfo.next = null;	    }	    removeRAs = removeRAs.nextRemove;	    r.nextRemove = null;	    r.prevRemove = null;	    if (r.isOriented()) {		renderBin.orientedRAs.remove(renderBin.orientedRAs.indexOf(r));	    }	    if ((textureBin.environmentSet.lightBin.geometryBackground == null) &&		!isOpaqueOrInOG && renderBin.transpSortMode == View.TRANSPARENCY_SORT_GEOMETRY) {		renderBin.removeTransparentObject(r);	    }	}	// If this renderMolecule will not be touched for adding new RenderAtoms	// then ..	if (addRAs == null) {	    // If there are no more renderAtoms and there will be no more	    // renderatoms added to this renderMolecule , then remove	    if (numRenderAtoms == 0) {		// If both lists are empty remove this renderMolecule		if ((primaryMoleculeType &DLIST_MOLECULE) != 0) {		    renderBin.addDisplayListResourceFreeList(this);		    vwcBounds.set(null);		    displayListId = 0;		    displayListIdObj = null;		}	    		if (locale != renderBin.locale) {		    localeLocalToVworld = null;		}		textureBin.removeRenderMolecule(this);	    } else {		if ((primaryMoleculeType &DLIST_MOLECULE) != 0 && primaryChanged) {		    // If a renderAtom is added to the display list		    // structure then add this to the dirty list of rm		    // for which the display list needs to be recreated		    renderBin.addDirtyRenderMolecule(this); 		    vwcBounds.set(null);		    rinfo = primaryRenderAtomList;		    while (rinfo != null) {			vwcBounds.combine(rinfo.renderAtom.localeVwcBounds);			rinfo = rinfo.next;		    }		    primaryChanged = false;		}	    	    }	}	numEditingRenderAtoms = numRenderAtoms;    }    public void updateObject() {	int i;	RenderAtom renderAtom;	RenderAtomListInfo r;	if (textureBin == null) {	    return;	}	if (addRAs != null) {	    while (addRAs != null) {		numRenderAtoms++;		renderAtom = (RenderAtom)addRAs;		renderAtom.renderMolecule = this;		renderAtom.added = null;		for (int j = 0; j < renderAtom.rListInfo.length; j++) {		    r = (RenderAtomListInfo)renderAtom.rListInfo[j];		    // Don't add null geo		    if (r.geometry() == null)			continue;		    r.groupType = evalRinfoGroupType(r);		    if ((r.groupType & RenderAtom.PRIMARY) != 0) {			if ((r.groupType & RenderAtom.DLIST) != 0 && primaryRenderMethod == null) {			    primaryMoleculeType = DLIST_MOLECULE;			    renderBin.renderMoleculeList.add(this);			    			    if (vwcBounds == null)				vwcBounds = new BoundingBox((BoundingBox)null);			    primaryRenderMethod = 				VirtualUniverse.mc.getDisplayListRenderMethod();			    // Assign a displayListId for this renderMolecule			    if (displayListId == 0) {				displayListIdObj = VirtualUniverse.mc.getDisplayListId();				displayListId =  displayListIdObj.intValue();			    }			}			else if ((r.groupType & RenderAtom.SEPARATE_DLIST_PER_RINFO) != 0 &&				 primaryRenderMethod == null) {			    primaryMoleculeType = SEPARATE_DLIST_PER_RINFO_MOLECULE;			    renderBin.renderMoleculeList.add(this);			    primaryRenderMethod = 				VirtualUniverse.mc.getDisplayListRenderMethod();			}			primaryChanged = true;			if (primaryRenderAtomList == null) {			    primaryRenderAtomList = r;			}			else {			    r.next = primaryRenderAtomList;			    primaryRenderAtomList.prev = r;			    primaryRenderAtomList = r;			}			if (primaryMoleculeType == SEPARATE_DLIST_PER_RINFO_MOLECULE) {			    if (r.renderAtom.dlistIds == null) {				r.renderAtom.dlistIds = new int[r.renderAtom.rListInfo.length];				for (int k = 0; k < r.renderAtom.dlistIds.length; k++) {				    r.renderAtom.dlistIds[k] = -1;				}			    }			    if (r.renderAtom.dlistIds[r.index] == -1) {				r.renderAtom.dlistIds[r.index] = VirtualUniverse.mc.getDisplayListId().intValue();				renderBin.addDlistPerRinfo.add(r);			    }			}			// If the molecule type is Raster, then add it to the lock list			if (primaryMoleculeType == RASTER) {			    RasterRetained geo = (RasterRetained)r.geometry();			    renderBin.addGeometryToLockList(geo);			    if (geo.image != null)				renderBin.addNodeComponent(geo.image);			}		    }		    else if ((r.groupType & RenderAtom.SEPARATE_DLIST_PER_GEO) != 0) {			if (separateDlistRenderAtomList == null) {			    separateDlistRenderAtomList = r;			}			else {			    r.next = separateDlistRenderAtomList;			    separateDlistRenderAtomList.prev = r;			    separateDlistRenderAtomList = r;						}			((GeometryArrayRetained)r.geometry()).assignDlistId();			renderBin.addGeometryDlist(r);		    }		    else {			if (secondaryRenderMethod == null) 			    secondaryRenderMethod = cachedVertexArrayRenderMethod;			if (vertexArrayRenderAtomList == null) {			    vertexArrayRenderAtomList = r;			}			else {			    r.next = vertexArrayRenderAtomList;			    vertexArrayRenderAtomList.prev = r;			    vertexArrayRenderAtomList = r;						}			// For indexed geometry there is no need to lock since			// the mirror is changed only when the renderer is not			// running			// For indexed geometry, if use_coord is set, then either we			// are using the index geometry as is or we will be unindexifying			// on the fly, so its better to loc			GeometryArrayRetained geo = (GeometryArrayRetained)r.geometry();			if (!(geo instanceof IndexedGeometryArrayRetained) ||			    ((geo.vertexFormat & GeometryArray.USE_COORD_INDEX_ONLY) != 0)) {			    renderBin.addGeometryToLockList(geo);			    // Add the geometry to the dirty list only if the geometry is by			    // refernce and there is color and we need to use alpha                            // Issue 113 - ignore multiScreen			    if ((( geo.vertexFormat & GeometryArray.BY_REFERENCE)!=0) &&				(geo.c4fAllocated == 0) && 				((geo.vertexFormat & GeometryArray.COLOR) != 0) &&

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -