[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.58,1.59
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-12-20 13:55:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29378/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Changed Surface.isInner to Surface.exterior pointing to the exterior Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Surface.java 20 Dec 2005 12:23:14 -0000 1.58 --- Surface.java 20 Dec 2005 13:54:53 -0000 1.59 *************** *** 35,43 **** private List edges; ! /** The inner surfaces of this surface (for holes) */ ! private Set innerSurfaces; ! ! /** Tells if this is an inner surface */ ! private boolean isInner; /** The domain in front of the surface */ --- 35,40 ---- private List edges; ! /** The holdes of this surface */ ! private Set holes; /** The domain in front of the surface */ *************** *** 47,50 **** --- 44,50 ---- private Space backDomain; + /** The exterior surface if this is a hole */ + private Surface exterior; + /** Surface is clockwise */ *************** *** 319,324 **** /** ! * Get the inner surfaces ! * @return The inner surfaces * @hibernate.set * lazy="false" --- 319,324 ---- /** ! * Get the hole surfaces ! * @return The hole surfaces * @hibernate.set * lazy="false" *************** *** 328,341 **** * class="net.sourceforge.bprocessor.model.Surface" */ ! public Set getInnerSurfaces() { ! return innerSurfaces; } /** ! * Set the inner surfaces ! * @param is The inner surfaces */ ! public void setInnerSurfaces(Set is) { ! this.innerSurfaces = is; } --- 328,341 ---- * class="net.sourceforge.bprocessor.model.Surface" */ ! public Set getHoles() { ! return holes; } /** ! * Set the hole surfaces ! * @param holes The hole surfaces */ ! public void setHoles(Set holes) { ! this.holes = holes; } *************** *** 477,507 **** /** * Adds a hole surface to this surface. ! * @param inner the hole to add. */ ! public void addHole(Surface inner) { ! if (innerSurfaces == null) { ! innerSurfaces = new HashSet(); } ! innerSurfaces.add(inner); ! inner.setIsInner(true); Vertex normal = normal(); ! Vertex other = inner.normal(); double dot = normal.dot(other); Space front = getFrontDomain(); Space back = getBackDomain(); if (dot > 0) { ! if (inner.getFrontDomain() == null) { ! inner.setFrontDomain(front); } ! if (inner.getBackDomain() == null) { ! inner.setBackDomain(back); } } else { ! if (inner.getFrontDomain() == null) { ! inner.setFrontDomain(back); } ! if (inner.getBackDomain() == null) { ! inner.setBackDomain(front); } } --- 477,507 ---- /** * Adds a hole surface to this surface. ! * @param hole the hole to add. */ ! public void addHole(Surface hole) { ! if (holes == null) { ! holes = new HashSet(); } ! holes.add(hole); ! hole.setExterior(this); Vertex normal = normal(); ! Vertex other = hole.normal(); double dot = normal.dot(other); Space front = getFrontDomain(); Space back = getBackDomain(); if (dot > 0) { ! if (hole.getFrontDomain() == null) { ! hole.setFrontDomain(front); } ! if (hole.getBackDomain() == null) { ! hole.setBackDomain(back); } } else { ! if (hole.getFrontDomain() == null) { ! hole.setFrontDomain(back); } ! if (hole.getBackDomain() == null) { ! hole.setBackDomain(front); } } *************** *** 510,521 **** /** * Removes a hole from this surface ! * @param inner the hole to remove */ ! public void removeHole(Surface inner) { ! innerSurfaces.remove(inner); } /** ! * Move this Surface and all inner surfaces a distance (dx, dy, dz) * @param dx The x distance * @param dy The y distance --- 510,522 ---- /** * Removes a hole from this surface ! * @param hole the hole to remove */ ! public void removeHole(Surface hole) { ! holes.remove(hole); ! hole.setExterior(null); } /** ! * Move this Surface and all holes a distance (dx, dy, dz) * @param dx The x distance * @param dy The y distance *************** *** 536,541 **** } { ! if (getInnerSurfaces() != null) { ! Iterator iter = getInnerSurfaces().iterator(); while (iter.hasNext()) { Surface surface = (Surface) iter.next(); --- 537,542 ---- } { ! if (getHoles() != null) { ! Iterator iter = getHoles().iterator(); while (iter.hasNext()) { Surface surface = (Surface) iter.next(); *************** *** 545,554 **** } ! if (this.isInner) { Set surfaces = Project.getInstance().getSurfaces(); Iterator surfIt = surfaces.iterator(); while (surfIt.hasNext()) { Surface surf = (Surface)surfIt.next(); ! Set inners = surf.getInnerSurfaces(); if (inners != null) { Iterator innerIt = inners.iterator(); --- 546,555 ---- } ! if (this.isInner()) { Set surfaces = Project.getInstance().getSurfaces(); Iterator surfIt = surfaces.iterator(); while (surfIt.hasNext()) { Surface surf = (Surface)surfIt.next(); ! Set inners = surf.getHoles(); if (inners != null) { Iterator innerIt = inners.iterator(); *************** *** 572,577 **** } { ! if (getInnerSurfaces() != null) { ! Iterator iter = getInnerSurfaces().iterator(); while (iter.hasNext()) { Surface surface = (Surface) iter.next(); --- 573,578 ---- } { ! if (getHoles() != null) { ! Iterator iter = getHoles().iterator(); while (iter.hasNext()) { Surface surface = (Surface) iter.next(); *************** *** 622,640 **** } ! /** ! * Get the whether this is an inner surface. ! * @return wheter or not this is an inner surface ! * @hibernate.property */ ! public boolean getIsInner() { ! return isInner; } /** ! * Set this surface to be an inner surface. ! * @param isInner whether or not this is an inner surface. */ ! public void setIsInner(boolean isInner) { ! this.isInner = isInner; } --- 623,648 ---- } ! /** ! * Get the exterior ! * @return The exterior surface */ ! public Surface getExterior() { ! return exterior; } /** ! * Set the exterior ! * @param exterior The exterior surface */ ! public void setExterior(Surface exterior) { ! this.exterior = exterior; ! } ! ! /** ! * Is this an inner surface ! * @return True if inner surface ! */ ! public boolean isInner() { ! return (exterior != null); } |