Class Index | File Index

Classes


Class Room


Extends HomeObject.

Defined in: SweetHome3D.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Room(id, points)
Creates a room from its name and the given coordinates.
Method Summary
Method Attributes Method Name and Description
 
addPoint(x, y, index)
Adds a point at the given index.
 
Returns a clone of this room.
 
containsPoint(x, y, margin)
Returns true if this room contains the point at (x, y) with a given margin.
 
Returns the area of this room.
 
Returns the angle in radians used to display the room area.
 
Returns the text style used to display room area.
 
Returns the distance along x axis applied to room center abscissa to display room area.
 
Returns the distance along y axis applied to room center ordinate to display room area.
 
Returns the maximum coordinates of the rectangle bounding this room.
 
Returns the minimum coordinates of the rectangle bounding this room.
 
Returns the ceiling color color of this room.
 
Returns the ceiling shininess of this room.
 
Returns the ceiling texture of this room.
 
Returns the floor color of this room.
 
Returns the floor shininess of this room.
 
Returns the floor texture of this room.
 
Returns the level which this room belongs to.
 
Returns the name of this room.
 
Returns the angle in radians used to display the room name.
 
Returns the text style used to display room name.
 
Returns the distance along x axis applied to room center abscissa to display room name.
 
Returns the distance along y axis applied to room center ordinate to display room name.
 
Returns the number of points of the polygon matching this room.
 
getPointIndexAt(x, y, margin)
Returns the index of the point of this room equal to the point at (x, y) with a given margin.
 
Returns the points of the polygon matching this room.
 
Returns the abscissa of the center point of this room.
 
Returns the ordinate of the center point of this room.
 
intersectsRectangle(x0, y0, x1, y1)
Returns true if this room intersects with the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).
 
isAreaCenterPointAt(x, y, margin)
Returns true if the center point at which is displayed the area of this room is equal to the point at (x, y) with a given margin.
 
Returns whether the area of this room is visible or not.
 
isAtLevel(level)
Returns true if this room is at the given level or at a level with the same elevation and a smaller elevation index.
 
Returns true if the ceiling should remain flat whatever its environment.
 
Returns whether the ceiling of this room is visible or not.
 
Returns true if the points of this room are in clockwise order.
 
Returns whether the floor of this room is visible or not.
 
isNameCenterPointAt(x, y, margin)
Returns true if the center point at which is displayed the name of this room is equal to the point at (x, y) with a given margin.
 
Returns true if this room is comprised of only one polygon.
 
move(dx, dy)
Moves this room of (dx, dy) units.
 
removePoint(index)
Removes the point at the given index.
 
setAreaAngle(areaAngle)
Sets the angle in radians used to display the room area.
 
setAreaStyle(areaStyle)
Sets the text style used to display room area.
 
setAreaVisible(areaVisible)
Sets whether the area of this room is visible or not.
 
setAreaXOffset(areaXOffset)
Sets the distance along x axis applied to room center abscissa to display room area.
 
setAreaYOffset(areaYOffset)
Sets the distance along y axis applied to room center ordinate to display room area.
 
setCeilingColor(ceilingColor)
Sets the ceiling color of this room.
 
setCeilingFlat(ceilingFlat)
Sets whether the floor texture should remain flat.
 
setCeilingShininess(ceilingShininess)
Sets the ceiling shininess of this room.
 
setCeilingTexture(ceilingTexture)
Sets the ceiling texture of this room.
 
setCeilingVisible(ceilingVisible)
Sets whether the ceiling of this room is visible or not.
 
setFloorColor(floorColor)
Sets the floor color of this room.
 
setFloorShininess(floorShininess)
Sets the floor shininess of this room.
 
setFloorTexture(floorTexture)
Sets the floor texture of this room.
 
setFloorVisible(floorVisible)
Sets whether the floor of this room is visible or not.
 
setLevel(level)
Sets the level of this room.
 
setName(name)
Sets the name of this room.
 
setNameAngle(nameAngle)
Sets the angle in radians used to display the room name.
 
setNameStyle(nameStyle)
Sets the text style used to display room name.
 
setNameXOffset(nameXOffset)
Sets the distance along x axis applied to room center abscissa to display room name.
 
setNameYOffset(nameYOffset)
Sets the distance along y axis applied to room center ordinate to display room name.
 
setPoint(x, y, index)
Sets the point at the given index.
 
setPoints(points)
Sets the points of the polygon matching this room.
Methods borrowed from class HomeObject:
duplicate, firePropertyChange, getContentProperty, getId, getProperty, getPropertyNames, isContentProperty, setProperty
Class Detail
Room(id, points)
Creates a room from its name and the given coordinates.
Author: Emmanuel Puybaret.
Parameters:
{string} id
{float[][]} points
Method Detail
addPoint(x, y, index)
Adds a point at the given index.
Parameters:
{number} x
{number} y
{number} index
Throws:
IndexOutOfBoundsException if index is negative or > getPointCount()

{Room} clone()
Returns a clone of this room.
Returns:
{Room}

{boolean} containsPoint(x, y, margin)
Returns true if this room contains the point at (x, y) with a given margin.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{number} getArea()
Returns the area of this room.
Returns:
{number}

{number} getAreaAngle()
Returns the angle in radians used to display the room area.
Returns:
{number}

{TextStyle} getAreaStyle()
Returns the text style used to display room area.
Returns:
{TextStyle}

{number} getAreaXOffset()
Returns the distance along x axis applied to room center abscissa to display room area.
Returns:
{number}

{number} getAreaYOffset()
Returns the distance along y axis applied to room center ordinate to display room area.
Returns:
{number}

{float[]} getBoundsMaximumCoordinates()
Returns the maximum coordinates of the rectangle bounding this room.
Returns:
{float[]}

{float[]} getBoundsMinimumCoordinates()
Returns the minimum coordinates of the rectangle bounding this room.
Returns:
{float[]}

{number} getCeilingColor()
Returns the ceiling color color of this room.
Returns:
{number}

{number} getCeilingShininess()
Returns the ceiling shininess of this room.
Returns:
{number} a value between 0 (matt) and 1 (very shiny)

{HomeTexture} getCeilingTexture()
Returns the ceiling texture of this room.
Returns:
{HomeTexture}

{number} getFloorColor()
Returns the floor color of this room.
Returns:
{number}

{number} getFloorShininess()
Returns the floor shininess of this room.
Returns:
{number} a value between 0 (matt) and 1 (very shiny)

{HomeTexture} getFloorTexture()
Returns the floor texture of this room.
Returns:
{HomeTexture}

{Level} getLevel()
Returns the level which this room belongs to.
Returns:
{Level}

{string} getName()
Returns the name of this room.
Returns:
{string}

{number} getNameAngle()
Returns the angle in radians used to display the room name.
Returns:
{number}

{TextStyle} getNameStyle()
Returns the text style used to display room name.
Returns:
{TextStyle}

{number} getNameXOffset()
Returns the distance along x axis applied to room center abscissa to display room name.
Returns:
{number}

{number} getNameYOffset()
Returns the distance along y axis applied to room center ordinate to display room name.
Returns:
{number}

{number} getPointCount()
Returns the number of points of the polygon matching this room.
Returns:
{number}

{number} getPointIndexAt(x, y, margin)
Returns the index of the point of this room equal to the point at (x, y) with a given margin.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{number} the index of the first found point or -1.

{float[][]} getPoints()
Returns the points of the polygon matching this room.
Returns:
{float[][]} an array of the (x,y) coordinates of the room points.

{number} getXCenter()
Returns the abscissa of the center point of this room.
Returns:
{number}

{number} getYCenter()
Returns the ordinate of the center point of this room.
Returns:
{number}

{boolean} intersectsRectangle(x0, y0, x1, y1)
Returns true if this room intersects with the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).
Parameters:
{number} x0
{number} y0
{number} x1
{number} y1
Returns:
{boolean}

{boolean} isAreaCenterPointAt(x, y, margin)
Returns true if the center point at which is displayed the area of this room is equal to the point at (x, y) with a given margin.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isAreaVisible()
Returns whether the area of this room is visible or not.
Returns:
{boolean}

{boolean} isAtLevel(level)
Returns true if this room is at the given level or at a level with the same elevation and a smaller elevation index.
Parameters:
{Level} level
Returns:
{boolean}

{boolean} isCeilingFlat()
Returns true if the ceiling should remain flat whatever its environment.
Returns:
{boolean}

{boolean} isCeilingVisible()
Returns whether the ceiling of this room is visible or not.
Returns:
{boolean}

{boolean} isClockwise()
Returns true if the points of this room are in clockwise order.
Returns:
{boolean}

{boolean} isFloorVisible()
Returns whether the floor of this room is visible or not.
Returns:
{boolean}

{boolean} isNameCenterPointAt(x, y, margin)
Returns true if the center point at which is displayed the name of this room is equal to the point at (x, y) with a given margin.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isSingular()
Returns true if this room is comprised of only one polygon.
Returns:
{boolean}

move(dx, dy)
Moves this room of (dx, dy) units.
Parameters:
{number} dx
{number} dy

removePoint(index)
Removes the point at the given index.
Parameters:
{number} index
Throws:
IndexOutOfBoundsException if index is negative or >= getPointCount()

setAreaAngle(areaAngle)
Sets the angle in radians used to display the room area. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} areaAngle

setAreaStyle(areaStyle)
Sets the text style used to display room area. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{TextStyle} areaStyle

setAreaVisible(areaVisible)
Sets whether the area of this room is visible or not. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{boolean} areaVisible

setAreaXOffset(areaXOffset)
Sets the distance along x axis applied to room center abscissa to display room area. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} areaXOffset

setAreaYOffset(areaYOffset)
Sets the distance along y axis applied to room center ordinate to display room area. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} areaYOffset

setCeilingColor(ceilingColor)
Sets the ceiling color of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} ceilingColor

setCeilingFlat(ceilingFlat)
Sets whether the floor texture should remain flat. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{boolean} ceilingFlat

setCeilingShininess(ceilingShininess)
Sets the ceiling shininess of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} ceilingShininess

setCeilingTexture(ceilingTexture)
Sets the ceiling texture of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{HomeTexture} ceilingTexture

setCeilingVisible(ceilingVisible)
Sets whether the ceiling of this room is visible or not. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{boolean} ceilingVisible

setFloorColor(floorColor)
Sets the floor color of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} floorColor

setFloorShininess(floorShininess)
Sets the floor shininess of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} floorShininess

setFloorTexture(floorTexture)
Sets the floor texture of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{HomeTexture} floorTexture

setFloorVisible(floorVisible)
Sets whether the floor of this room is visible or not. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{boolean} floorVisible

setLevel(level)
Sets the level of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{Level} level

setName(name)
Sets the name of this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{string} name

setNameAngle(nameAngle)
Sets the angle in radians used to display the room name. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} nameAngle

setNameStyle(nameStyle)
Sets the text style used to display room name. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{TextStyle} nameStyle

setNameXOffset(nameXOffset)
Sets the distance along x axis applied to room center abscissa to display room name. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} nameXOffset

setNameYOffset(nameYOffset)
Sets the distance along y axis applied to room center ordinate to display room name. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{number} nameYOffset

setPoint(x, y, index)
Sets the point at the given index.
Parameters:
{number} x
{number} y
{number} index
Throws:
IndexOutOfBoundsException if index is negative or >= getPointCount()

setPoints(points)
Sets the points of the polygon matching this room. Once this room is updated, listeners added to this room will receive a change notification.
Parameters:
{float[][]} points

© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Aug 21 2024 17:43:24 GMT+0200 (CEST)