Class Index | File Index

Classes


Class HomePieceOfFurniture


Extends HomeObject.

Defined in: SweetHome3D.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a home piece of furniture from an existing piece.
Method Summary
Method Attributes Method Name and Description
 
Adds the property change listener in parameter to this piece.
 
Returns a clone of this piece.
 
Returns the angle in radians of this piece around vertical axis.
 
Returns the catalog ID of this piece of furniture or null if it doesn't exist.
 
Returns the color of this piece of furniture.
 
Returns the creator of this piece.
 
Returns the price currency, noted with ISO 4217 code, or null if it has no price or default currency should be used.
 
Returns the depth of this piece of furniture.
 
Returns the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
 
Returns the description of this piece of furniture.
 
Returns the elevation at which should be placed an object dropped on this piece.
 
Returns the elevation of the bottom of this piece of furniture on its level.
<static>  
HomePieceOfFurniture.getFurnitureComparator(property)
Returns a comparator that compares furniture on a given property in ascending order.
 
Returns the elevation of the bottom of this piece of furniture from the ground according to the elevation of its level.
 
Returns the height of this piece of furniture.
 
Returns the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it).
 
Returns the icon of this piece of furniture.
 
Returns the additional information associated to this piece, or null.
 
Returns the level which this piece belongs to.
 
Returns the 3D model of this piece of furniture.
 
Returns the materials applied to the 3D model of this piece of furniture.
 
Returns the rotation 3 by 3 matrix of this piece of furniture that ensures its model is correctly oriented.
 
Returns the size of the 3D model of this piece of furniture.
 
Returns the name of this piece of furniture.
 
Returns the angle in radians used to display the piece name.
 
Returns the text style used to display piece name.
 
Returns the distance along x axis applied to piece abscissa to display piece name.
 
Returns the distance along y axis applied to piece ordinate to display piece name.
 
Returns the pitch angle in radians of this piece of furniture.
 
Returns the icon of this piece of furniture displayed in plan or null.
 
Returns the price of this piece of furniture or null.
 
Returns the price of this piece of furniture, Value Added Tax included.
 
Returns the roll angle in radians of this piece of furniture.
 
Returns the shininess of this piece of furniture.
 
Returns the shape used to cut out upper levels when they intersect with the piece like a staircase.
 
Returns the texture of this piece of furniture.
 
Returns the Value Added Tax applied to the price of this piece of furniture.
 
Returns the Value Added Tax percentage applied to the price of this piece of furniture.
 
Returns the width of this piece of furniture.
 
Returns the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
 
getX()
Returns the abscissa of the center of this piece of furniture.
 
getY()
Returns the ordinate of the center of this piece of furniture.
 
intersectsRectangle(x0, y0, x1, y1)
Returns true if this piece intersects with the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).
 
isAtLevel(level)
Returns true if this piece is at the given level or at a level with the same elevation and a smaller elevation index or if the elevation of its highest point is higher than level elevation.
 
Returns true if the back face of the piece of furniture model should be displayed.
 
isBottomLeftPointAt(x, y, margin)
Returns true if the bottom left point of this piece is the point at (x, y) with a given margin, and if that point is closer to bottom left point than to top left and bottom right points.
 
isBottomRightPointAt(x, y, margin)
Returns true if the bottom right point of this piece is the point at (x, y) with a given margin, and if that point is closer to top left point than to top right and bottom left points.
 
Returns true if this piece is deformable.
 
Returns true if this piece of furniture is a door or a window.
 
Returns false if this piece should not rotate around an horizontal axis.
 
Returns true if the pitch or roll angle of this piece is different from 0.
 
Returns true if model center should be always centered at the origin when model rotation isn't null.
 
Returns true if the model of this piece should be mirrored.
 
Returns true if this piece of furniture is movable.
 
isNameCenterPointAt(x, y, margin)
Returns true if the center point at which is displayed the name of this piece is equal to the point at (x, y) with a given margin.
 
Returns whether the name of this piece should be drawn or not.
 
Returns true if the front side of this piece is parallel to the given wall with a margin.
 
isPointAt(x, y, margin)
Returns true if one of the corner of this piece is the point at (x, y) with a given margin.
 
Returns true if this piece is resizable.
 
Returns false if this piece should always keep the same color or texture.
 
isTopLeftPointAt(x, y, margin)
Returns true if the top left point of this piece is the point at (x, y) with a given margin, and if that point is closer to top left point than to top right and bottom left points.
 
isTopRightPointAt(x, y, margin)
Returns true if the top right point of this piece is the point at (x, y) with a given margin, and if that point is closer to top right point than to top left and bottom right points.
 
Returns true if this piece of furniture is visible.
 
Returns true if this piece is deformable.
 
move(dx, dy)
Moves this piece of (dx, dy) units.
 
Removes the property change listener in parameter from this piece.
 
scale(scale)
Scales this piece of furniture with the given scale.
 
setAngle(angle)
Sets the angle of this piece around vertical axis.
 
setColor(color)
Sets the color of this piece of furniture.
 
setDepth(depth)
Sets the depth of this piece of furniture.
 
setDepthInPlan(depthInPlan)
Sets the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
 
setDescription(description)
Sets the description of this piece of furniture.
 
setElevation(elevation)
Sets the elevation of this piece of furniture on its level.
 
setHeight(height)
Sets the height of this piece of furniture.
 
setHeightInPlan(heightInPlan)
Sets the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it).
 
setLevel(level)
Sets the level of this piece of furniture.
 
setModelCenteredAtOrigin(modelCenteredAtOrigin)
Sets whether model center should be always centered at the origin when model rotation isn't null.
 
setModelMaterials(modelMaterials)
Sets the materials of the 3D model of this piece of furniture.
 
setModelMirrored(modelMirrored)
Sets whether the model of this piece of furniture is mirrored or not.
 
setModelSize(modelSize)
Sets the size of the 3D model of this piece of furniture.
 
setMovable(movable)
Sets whether this piece is movable or not.
 
setName(name)
Sets the name of this piece of furniture.
 
setNameAngle(nameAngle)
Sets the angle in radians used to display the piece name.
 
setNameStyle(nameStyle)
Sets the text style used to display piece name.
 
setNameVisible(nameVisible)
Sets whether the name of this piece is visible or not.
 
setNameXOffset(nameXOffset)
Sets the distance along x axis applied to piece abscissa to display piece name.
 
setNameYOffset(nameYOffset)
Sets the distance along y axis applied to piece ordinate to display piece name.
 
setPitch(pitch)
Sets the pitch angle in radians of this piece and notifies listeners of this change.
 
setPrice(price)
Sets the price of this piece of furniture.
 
setRoll(roll)
Sets the roll angle in radians of this piece and notifies listeners of this change.
 
setShininess(shininess)
Sets the shininess of this piece of furniture or null if piece shininess is unchanged.
 
setTexture(texture)
Sets the texture of this piece of furniture.
 
setVisible(visible)
Sets whether this piece of furniture is visible or not.
 
setWidth(width)
Sets the width of this piece of furniture.
 
setWidthInPlan(widthInPlan)
Sets the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
 
setX(x)
Sets the abscissa of the center of this piece.
 
setY(y)
Sets the ordinate of the center of this piece.
Methods borrowed from class HomeObject:
getProperty, getPropertyNames, setProperty
Class Detail
HomePieceOfFurniture(piece)
Creates a home piece of furniture from an existing piece.
Author: Emmanuel Puybaret.
Parameters:
{Object} piece
the piece from which data are copied
Method Detail
addPropertyChangeListener(listener)
Adds the property change listener in parameter to this piece.
Parameters:
{PropertyChangeListener} listener

{HomePieceOfFurniture} clone()
Returns a clone of this piece.
Returns:
{HomePieceOfFurniture}

{number} getAngle()
Returns the angle in radians of this piece around vertical axis.
Returns:
{number}

{string} getCatalogId()
Returns the catalog ID of this piece of furniture or null if it doesn't exist.
Returns:
{string}

{number} getColor()
Returns the color of this piece of furniture.
Returns:
{number} the color of the piece as RGB code or null if piece color is unchanged.

{string} getCreator()
Returns the creator of this piece.
Returns:
{string}

{string} getCurrency()
Returns the price currency, noted with ISO 4217 code, or null if it has no price or default currency should be used.
Returns:
{string}

{number} getDepth()
Returns the depth of this piece of furniture.
Returns:
{number}

{number} getDepthInPlan()
Returns the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
Returns:
{number}

{string} getDescription()
Returns the description of this piece of furniture. The returned value may be null.
Returns:
{string}

{number} getDropOnTopElevation()
Returns the elevation at which should be placed an object dropped on this piece.
Returns:
{number} a percentage of the height of this piece. A negative value means that the piece should be ignored when an object is dropped on it.

{number} getElevation()
Returns the elevation of the bottom of this piece of furniture on its level.
Returns:
{number}

<static> {Object} HomePieceOfFurniture.getFurnitureComparator(property)
Returns a comparator that compares furniture on a given property in ascending order.
Parameters:
{string} property
Returns:
{Object}

{number} getGroundElevation()
Returns the elevation of the bottom of this piece of furniture from the ground according to the elevation of its level.
Returns:
{number}

{number} getHeight()
Returns the height of this piece of furniture.
Returns:
{number}

{number} getHeightInPlan()
Returns the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it).
Returns:
{number}

{Object} getIcon()
Returns the icon of this piece of furniture.
Returns:
{Object}

{string} getInformation()
Returns the additional information associated to this piece, or null.
Returns:
{string}

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

{Object} getModel()
Returns the 3D model of this piece of furniture.
Returns:
{Object}

{Array} getModelMaterials()
Returns the materials applied to the 3D model of this piece of furniture.
Returns:
{Array} the materials of the 3D model or null if the individual materials of the 3D model are not modified.

{Array} getModelRotation()
Returns the rotation 3 by 3 matrix of this piece of furniture that ensures its model is correctly oriented.
Returns:
{Array}

{number} getModelSize()
Returns the size of the 3D model of this piece of furniture.
Returns:
{number}

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

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

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

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

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

{number} getPitch()
Returns the pitch angle in radians of this piece of furniture.
Returns:
{number}

{Object} getPlanIcon()
Returns the icon of this piece of furniture displayed in plan or null.
Returns:
{Object}

{Big} getPrice()
Returns the price of this piece of furniture or null.
Returns:
{Big}

{Big} getPriceValueAddedTaxIncluded()
Returns the price of this piece of furniture, Value Added Tax included.
Returns:
{Big}

{number} getRoll()
Returns the roll angle in radians of this piece of furniture.
Returns:
{number}

{number} getShininess()
Returns the shininess of this piece of furniture.
Returns:
{number} a value between 0 (matt) and 1 (very shiny) or null if piece shininess is unchanged.

{string} getStaircaseCutOutShape()
Returns the shape used to cut out upper levels when they intersect with the piece like a staircase.
Returns:
{string}

{HomeTexture} getTexture()
Returns the texture of this piece of furniture.
Returns:
{HomeTexture} the texture of the piece or null if piece texture is unchanged.

{Big} getValueAddedTax()
Returns the Value Added Tax applied to the price of this piece of furniture.
Returns:
{Big}

{Big} getValueAddedTaxPercentage()
Returns the Value Added Tax percentage applied to the price of this piece of furniture.
Returns:
{Big}

{number} getWidth()
Returns the width of this piece of furniture.
Returns:
{number}

{number} getWidthInPlan()
Returns the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it).
Returns:
{number}

{number} getX()
Returns the abscissa of the center of this piece of furniture.
Returns:
{number}

{number} getY()
Returns the ordinate of the center of this piece of furniture.
Returns:
{number}

{boolean} intersectsRectangle(x0, y0, x1, y1)
Returns true if this piece 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} isAtLevel(level)
Returns true if this piece is at the given level or at a level with the same elevation and a smaller elevation index or if the elevation of its highest point is higher than level elevation.
Parameters:
{Level} level
Returns:
{boolean}

{boolean} isBackFaceShown()
Returns true if the back face of the piece of furniture model should be displayed.
Returns:
{boolean}

{boolean} isBottomLeftPointAt(x, y, margin)
Returns true if the bottom left point of this piece is the point at (x, y) with a given margin, and if that point is closer to bottom left point than to top left and bottom right points.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isBottomRightPointAt(x, y, margin)
Returns true if the bottom right point of this piece is the point at (x, y) with a given margin, and if that point is closer to top left point than to top right and bottom left points.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isDeformable()
Returns true if this piece is deformable.
Returns:
{boolean}

{boolean} isDoorOrWindow()
Returns true if this piece of furniture is a door or a window. As this method existed before {@linkplain HomeDoorOrWindow HomeDoorOrWindow} class, you shouldn't rely on the value returned by this method to guess if a piece is an instance of DoorOrWindow class.
Returns:
{boolean}

{boolean} isHorizontallyRotatable()
Returns false if this piece should not rotate around an horizontal axis.
Returns:
{boolean}

{boolean} isHorizontallyRotated()
Returns true if the pitch or roll angle of this piece is different from 0.
Returns:
{boolean}

{boolean} isModelCenteredAtOrigin()
Returns true if model center should be always centered at the origin when model rotation isn't null.
Returns:
{boolean} false by default if version < 5.5

{boolean} isModelMirrored()
Returns true if the model of this piece should be mirrored.
Returns:
{boolean}

{boolean} isMovable()
Returns true if this piece of furniture is movable.
Returns:
{boolean}

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

{boolean} isNameVisible()
Returns whether the name of this piece should be drawn or not.
Returns:
{boolean}

{boolean} isParallelToWall(wall)
Returns true if the front side of this piece is parallel to the given wall with a margin.
Parameters:
{Wall} wall
Returns:
{boolean}

{boolean} isPointAt(x, y, margin)
Returns true if one of the corner of this piece is the point at (x, y) with a given margin.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isResizable()
Returns true if this piece is resizable.
Returns:
{boolean}

{boolean} isTexturable()
Returns false if this piece should always keep the same color or texture.
Returns:
{boolean}

{boolean} isTopLeftPointAt(x, y, margin)
Returns true if the top left point of this piece is the point at (x, y) with a given margin, and if that point is closer to top left point than to top right and bottom left points.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isTopRightPointAt(x, y, margin)
Returns true if the top right point of this piece is the point at (x, y) with a given margin, and if that point is closer to top right point than to top left and bottom right points.
Parameters:
{number} x
{number} y
{number} margin
Returns:
{boolean}

{boolean} isVisible()
Returns true if this piece of furniture is visible.
Returns:
{boolean}

{boolean} isWidthDepthDeformable()
Returns true if this piece is deformable.
Returns:
{boolean}

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

removePropertyChangeListener(listener)
Removes the property change listener in parameter from this piece.
Parameters:
{PropertyChangeListener} listener

scale(scale)
Scales this piece of furniture with the given scale. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} scale

setAngle(angle)
Sets the angle of this piece around vertical axis. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} angle

setColor(color)
Sets the color of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} color
the color of this piece of furniture or null if piece color is the default one
Throws:
IllegalStateException if this piece of furniture isn't texturable

setDepth(depth)
Sets the depth of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} depth
Throws:
IllegalStateException if this piece of furniture isn't resizable

setDepthInPlan(depthInPlan)
Sets the depth of this piece of furniture in the horizontal plan (after pitch or roll is applied to it). listeners added to this piece will receive a change notification.
Parameters:
{number} depthInPlan

setDescription(description)
Sets the description of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{string} description

setElevation(elevation)
Sets the elevation of this piece of furniture on its level. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} elevation

setHeight(height)
Sets the height of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} height
Throws:
IllegalStateException if this piece of furniture isn't resizable

setHeightInPlan(heightInPlan)
Sets the height of this piece of furniture from the horizontal plan (after pitch or roll is applied to it). Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} heightInPlan

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

setModelCenteredAtOrigin(modelCenteredAtOrigin)
Sets whether model center should be always centered at the origin when model rotation isn't null. This method should be called only to keep unchanged the (wrong) location of a rotated model created with version < 5.5.
Parameters:
{boolean} modelCenteredAtOrigin

setModelMaterials(modelMaterials)
Sets the materials of the 3D model of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{Array} modelMaterials
the materials of the 3D model or null if they shouldn't be changed
Throws:
IllegalStateException if this piece of furniture isn't texturable

setModelMirrored(modelMirrored)
Sets whether the model of this piece of furniture is mirrored or not. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{boolean} modelMirrored
Throws:
IllegalStateException if this piece of furniture isn't resizable

setModelSize(modelSize)
Sets the size of the 3D model of this piece of furniture. This method should be called only to update a piece created with an older version.
Parameters:
{number} modelSize

setMovable(movable)
Sets whether this piece is movable or not.
Parameters:
{boolean} movable

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

setNameAngle(nameAngle)
Sets the angle in radians used to display the piece 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 piece name. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{TextStyle} nameStyle

setNameVisible(nameVisible)
Sets whether the name of this piece is visible or not. Once this piece of furniture is updated, listeners added to this piece will receive a change notification.
Parameters:
{boolean} nameVisible

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

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

setPitch(pitch)
Sets the pitch angle in radians of this piece and notifies listeners of this change. Pitch axis is horizontal lateral (or transverse) axis.
Parameters:
{number} pitch

setPrice(price)
Sets the price of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{Big} price

setRoll(roll)
Sets the roll angle in radians of this piece and notifies listeners of this change. Roll axis is horizontal longitudinal axis.
Parameters:
{number} roll

setShininess(shininess)
Sets the shininess of this piece of furniture or null if piece shininess is unchanged. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} shininess
Throws:
IllegalStateException if this piece of furniture isn't texturable

setTexture(texture)
Sets the texture of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{HomeTexture} texture
the texture of this piece of furniture or null if piece texture is the default one
Throws:
IllegalStateException if this piece of furniture isn't texturable

setVisible(visible)
Sets whether this piece of furniture is visible or not. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{boolean} visible

setWidth(width)
Sets the width of this piece of furniture. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} width
Throws:
IllegalStateException if this piece of furniture isn't resizable

setWidthInPlan(widthInPlan)
Sets the width of this piece of furniture in the horizontal plan (after pitch or roll is applied to it). Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} widthInPlan

setX(x)
Sets the abscissa of the center of this piece. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} x

setY(y)
Sets the ordinate of the center of this piece. Once this piece is updated, listeners added to this piece will receive a change notification.
Parameters:
{number} y

© Copyrights 2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 25 2017 16:36:09 GMT+0200 (CEST)