Sweet Home 3D 3.4

com.eteks.sweethome3d.model
Class CatalogPieceOfFurniture

java.lang.Object
  extended by com.eteks.sweethome3d.model.CatalogPieceOfFurniture
All Implemented Interfaces:
PieceOfFurniture, java.lang.Comparable<CatalogPieceOfFurniture>
Direct Known Subclasses:
CatalogDoorOrWindow, CatalogLight

public class CatalogPieceOfFurniture
extends java.lang.Object
implements java.lang.Comparable<CatalogPieceOfFurniture>, PieceOfFurniture

A catalog piece of furniture.

Author:
Emmanuel Puybaret

Constructor Summary
CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, boolean movable, boolean doorOrWindow)
          Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow
CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, boolean doorOrWindow, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
          Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow
CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
          Creates a modifiable catalog piece of furniture with all its values.
CatalogPieceOfFurniture(java.lang.String name, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.String staircaseCutOutShape, java.lang.Integer color, float[][] modelRotation, boolean backFaceShown, float iconYaw, boolean proportional)
          Creates a modifiable catalog piece of furniture with all its values.
CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
          Creates an unmodifiable catalog piece of furniture of the default catalog.
CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, boolean deformable, boolean texturable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
          Creates an unmodifiable catalog piece of furniture of the default catalog.
CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content planIcon, Content model, float width, float depth, float height, float elevation, boolean movable, java.lang.String staircaseCutOutShape, float[][] modelRotation, java.lang.String creator, boolean resizable, boolean deformable, boolean texturable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage, java.lang.String currency)
          Creates an unmodifiable catalog piece of furniture of the default catalog.
CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, boolean doorOrWindow, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
          Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow
CatalogPieceOfFurniture(java.lang.String id, java.lang.String name, java.lang.String description, Content icon, Content model, float width, float depth, float height, float elevation, boolean movable, float[][] modelRotation, java.lang.String creator, boolean resizable, java.math.BigDecimal price, java.math.BigDecimal valueAddedTaxPercentage)
          Creates an unmodifiable catalog piece of furniture of the default catalog.
 
Method Summary
 int compareTo(CatalogPieceOfFurniture piece)
          Compares the names of this piece and the one in parameter.
 boolean equals(java.lang.Object obj)
          Returns true if this piece and the one in parameter have the same name.
 FurnitureCategory getCategory()
          Returns the category of this piece of furniture.
 java.lang.Integer getColor()
          Returns the color of this piece of furniture.
 java.lang.String getCreator()
          Returns the creator of this piece.
 java.lang.String getCurrency()
          Returns the price currency, noted with ISO 4217 code, or null if it has no price or default currency should be used.
 float getDepth()
          Returns the depth of this piece of furniture.
 java.lang.String getDescription()
          Returns the description of this piece of furniture.
 float getElevation()
          Returns the elevation of this piece of furniture.
 float getHeight()
          Returns the height of this piece of furniture.
 Content getIcon()
          Returns the icon of this piece of furniture.
 float getIconYaw()
          Returns the yaw angle used to create the piece icon.
 java.lang.String getId()
          Returns the ID of this piece of furniture or null.
 Content getModel()
          Returns the 3D model of this piece of furniture.
 float[][] getModelRotation()
          Returns the rotation 3 by 3 matrix of this piece of furniture that ensures its model is correctly oriented.
 java.lang.String getName()
          Returns the name of this piece of furniture.
 Content getPlanIcon()
          Returns the icon of this piece of furniture displayed in plan or null.
 java.math.BigDecimal getPrice()
          Returns the price of this piece of furniture or null.
 java.lang.String getStaircaseCutOutShape()
          Returns the shape used to cut out upper levels when they intersect with the piece like a staircase.
 java.math.BigDecimal getValueAddedTaxPercentage()
          Returns the Value Added Tax percentage applied to the price of this piece of furniture.
 float getWidth()
          Returns the width of this piece of furniture.
 int hashCode()
          Returns a hash code computed from the name of this piece.
 boolean isBackFaceShown()
          Returns true if the back face of the piece of furniture model should be displayed.
 boolean isDeformable()
          Returns true if this piece is deformable.
 boolean isDoorOrWindow()
          Returns true if this piece of furniture is a door or a window.
 boolean isModifiable()
          Returns true if this piece is modifiable (not read from resources).
 boolean isMovable()
          Returns true if this piece of furniture is movable.
 boolean isProportional()
          Returns true if size proportions should be kept.
 boolean isResizable()
          Returns true if this piece is resizable.
 boolean isTexturable()
          Returns false if this piece should always keep the same color or texture.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String name,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               boolean movable,
                               boolean doorOrWindow)
Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow

Creates a catalog piece of furniture.

Parameters:
name - the name of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
movable - if true, the new piece is movable
doorOrWindow - if true, the new piece is a door or a window

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String id,
                               java.lang.String name,
                               java.lang.String description,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               boolean doorOrWindow,
                               float[][] modelRotation,
                               java.lang.String creator,
                               boolean resizable,
                               java.math.BigDecimal price,
                               java.math.BigDecimal valueAddedTaxPercentage)
Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow

Creates an unmodifiable catalog piece of furniture of the default catalog.

Parameters:
id - the id of the new piece or null
name - the name of the new piece
description - the description of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
doorOrWindow - if true, the new piece is a door or a window
modelRotation - the rotation 3 by 3 matrix applied to the piece model
creator - the creator of the model
resizable - if true, the size of the new piece may be edited
price - the price of the new piece or null
valueAddedTaxPercentage - the Value Added Tax percentage applied to the price of the new piece or null

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String id,
                               java.lang.String name,
                               java.lang.String description,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               float[][] modelRotation,
                               java.lang.String creator,
                               boolean resizable,
                               java.math.BigDecimal price,
                               java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.

Parameters:
id - the id of the new piece or null
name - the name of the new piece
description - the description of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
modelRotation - the rotation 3 by 3 matrix applied to the piece model
creator - the creator of the model
resizable - if true, the size of the new piece may be edited
price - the price of the new piece or null
valueAddedTaxPercentage - the Value Added Tax percentage applied to the price of the new piece or null
Since:
1.7

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String id,
                               java.lang.String name,
                               java.lang.String description,
                               Content icon,
                               Content planIcon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               float[][] modelRotation,
                               java.lang.String creator,
                               boolean resizable,
                               java.math.BigDecimal price,
                               java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.

Parameters:
id - the id of the new piece or null
name - the name of the new piece
description - the description of the new piece
icon - content of the icon of the new piece
planIcon - content of the icon of the new piece displayed in plan
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
modelRotation - the rotation 3 by 3 matrix applied to the piece model
creator - the creator of the model
resizable - if true, the size of the new piece may be edited
price - the price of the new piece or null
valueAddedTaxPercentage - the Value Added Tax percentage applied to the price of the new piece or null
Since:
2.2

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String id,
                               java.lang.String name,
                               java.lang.String description,
                               Content icon,
                               Content planIcon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               float[][] modelRotation,
                               java.lang.String creator,
                               boolean resizable,
                               boolean deformable,
                               boolean texturable,
                               java.math.BigDecimal price,
                               java.math.BigDecimal valueAddedTaxPercentage)
Creates an unmodifiable catalog piece of furniture of the default catalog.

Parameters:
id - the id of the new piece or null
name - the name of the new piece
description - the description of the new piece
icon - content of the icon of the new piece
planIcon - content of the icon of the new piece displayed in plan
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
modelRotation - the rotation 3 by 3 matrix applied to the piece model
creator - the creator of the model
resizable - if true, the size of the new piece may be edited
deformable - if true, the width, depth and height of the new piece may change independently from each other
texturable - if false this piece should always keep the same color or texture.
price - the price of the new piece or null
valueAddedTaxPercentage - the Value Added Tax percentage applied to the price of the new piece or null
Since:
3.0

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String id,
                               java.lang.String name,
                               java.lang.String description,
                               Content icon,
                               Content planIcon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               java.lang.String staircaseCutOutShape,
                               float[][] modelRotation,
                               java.lang.String creator,
                               boolean resizable,
                               boolean deformable,
                               boolean texturable,
                               java.math.BigDecimal price,
                               java.math.BigDecimal valueAddedTaxPercentage,
                               java.lang.String currency)
Creates an unmodifiable catalog piece of furniture of the default catalog.

Parameters:
id - the id of the new piece or null
name - the name of the new piece
description - the description of the new piece
icon - content of the icon of the new piece
planIcon - content of the icon of the new piece displayed in plan
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
staircaseCutOutShape - the shape used to cut out upper levels when they intersect with the piece like a staircase
modelRotation - the rotation 3 by 3 matrix applied to the piece model
creator - the creator of the model
resizable - if true, the size of the new piece may be edited
deformable - if true, the width, depth and height of the new piece may change independently from each other
texturable - if false this piece should always keep the same color or texture.
price - the price of the new piece or null
valueAddedTaxPercentage - the Value Added Tax percentage applied to the price of the new piece or null
currency - the price currency, noted with ISO 4217 code, or null
Since:
3.4

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String name,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               boolean doorOrWindow,
                               java.lang.Integer color,
                               float[][] modelRotation,
                               boolean backFaceShown,
                               float iconYaw,
                               boolean proportional)
Deprecated. As of version 1.7, use constructor without doorOrWindow parameter since a catalog door and window is supposed to be an instance of CatalogDoorOrWindow

Creates a modifiable catalog piece of furniture with all its values.

Parameters:
name - the name of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
doorOrWindow - if true, the new piece is a door or a window
color - the color of the piece as RGB code or null if piece color is unchanged
modelRotation - the rotation 3 by 3 matrix applied to the piece model
backFaceShown - true if back face should be shown
iconYaw - the yaw angle used to create the piece icon
proportional - if true, size proportions will be kept

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String name,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               java.lang.Integer color,
                               float[][] modelRotation,
                               boolean backFaceShown,
                               float iconYaw,
                               boolean proportional)
Creates a modifiable catalog piece of furniture with all its values.

Parameters:
name - the name of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
color - the color of the piece as RGB code or null if piece color is unchanged
modelRotation - the rotation 3 by 3 matrix applied to the piece model
backFaceShown - true if back face should be shown
iconYaw - the yaw angle used to create the piece icon
proportional - if true, size proportions will be kept
Since:
1.7

CatalogPieceOfFurniture

public CatalogPieceOfFurniture(java.lang.String name,
                               Content icon,
                               Content model,
                               float width,
                               float depth,
                               float height,
                               float elevation,
                               boolean movable,
                               java.lang.String staircaseCutOutShape,
                               java.lang.Integer color,
                               float[][] modelRotation,
                               boolean backFaceShown,
                               float iconYaw,
                               boolean proportional)
Creates a modifiable catalog piece of furniture with all its values.

Parameters:
name - the name of the new piece
icon - content of the icon of the new piece
model - content of the 3D model of the new piece
width - the width in centimeters of the new piece
depth - the depth in centimeters of the new piece
height - the height in centimeters of the new piece
elevation - the elevation in centimeters of the new piece
movable - if true, the new piece is movable
staircaseCutOutShape - the shape used to cut out upper levels when they intersect with the piece like a staircase
color - the color of the piece as RGB code or null if piece color is unchanged
modelRotation - the rotation 3 by 3 matrix applied to the piece model
backFaceShown - true if back face should be shown
iconYaw - the yaw angle used to create the piece icon
proportional - if true, size proportions will be kept
Since:
3.4
Method Detail

getId

public java.lang.String getId()
Returns the ID of this piece of furniture or null.


getName

public java.lang.String getName()
Returns the name of this piece of furniture.

Specified by:
getName in interface PieceOfFurniture

getDescription

public java.lang.String getDescription()
Returns the description of this piece of furniture. The returned value may be null.

Specified by:
getDescription in interface PieceOfFurniture

getDepth

public float getDepth()
Returns the depth of this piece of furniture.

Specified by:
getDepth in interface PieceOfFurniture

getHeight

public float getHeight()
Returns the height of this piece of furniture.

Specified by:
getHeight in interface PieceOfFurniture

getWidth

public float getWidth()
Returns the width of this piece of furniture.

Specified by:
getWidth in interface PieceOfFurniture

getElevation

public float getElevation()
Returns the elevation of this piece of furniture.

Specified by:
getElevation in interface PieceOfFurniture

isMovable

public boolean isMovable()
Returns true if this piece of furniture is movable.

Specified by:
isMovable in interface PieceOfFurniture

isDoorOrWindow

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

Specified by:
isDoorOrWindow in interface PieceOfFurniture

getIcon

public Content getIcon()
Returns the icon of this piece of furniture.

Specified by:
getIcon in interface PieceOfFurniture

getPlanIcon

public Content getPlanIcon()
Returns the icon of this piece of furniture displayed in plan or null.

Specified by:
getPlanIcon in interface PieceOfFurniture
Since:
2.2

getModel

public Content getModel()
Returns the 3D model of this piece of furniture.

Specified by:
getModel in interface PieceOfFurniture

getModelRotation

public float[][] getModelRotation()
Returns the rotation 3 by 3 matrix of this piece of furniture that ensures its model is correctly oriented.

Specified by:
getModelRotation in interface PieceOfFurniture

getStaircaseCutOutShape

public java.lang.String getStaircaseCutOutShape()
Returns the shape used to cut out upper levels when they intersect with the piece like a staircase.

Specified by:
getStaircaseCutOutShape in interface PieceOfFurniture
Since:
3.4

getCreator

public java.lang.String getCreator()
Returns the creator of this piece.


isBackFaceShown

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

Specified by:
isBackFaceShown in interface PieceOfFurniture

getColor

public java.lang.Integer getColor()
Returns the color of this piece of furniture.

Specified by:
getColor in interface PieceOfFurniture

getIconYaw

public float getIconYaw()
Returns the yaw angle used to create the piece icon.


isProportional

public boolean isProportional()
Returns true if size proportions should be kept.


isModifiable

public boolean isModifiable()
Returns true if this piece is modifiable (not read from resources).


isResizable

public boolean isResizable()
Returns true if this piece is resizable.

Specified by:
isResizable in interface PieceOfFurniture

isDeformable

public boolean isDeformable()
Returns true if this piece is deformable.

Specified by:
isDeformable in interface PieceOfFurniture
Since:
3.0

isTexturable

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

Specified by:
isTexturable in interface PieceOfFurniture
Since:
3.0

getPrice

public java.math.BigDecimal getPrice()
Returns the price of this piece of furniture or null.

Specified by:
getPrice in interface PieceOfFurniture

getValueAddedTaxPercentage

public java.math.BigDecimal getValueAddedTaxPercentage()
Returns the Value Added Tax percentage applied to the price of this piece of furniture.

Specified by:
getValueAddedTaxPercentage in interface PieceOfFurniture

getCurrency

public java.lang.String getCurrency()
Returns the price currency, noted with ISO 4217 code, or null if it has no price or default currency should be used.

Specified by:
getCurrency in interface PieceOfFurniture
Since:
3.4

getCategory

public FurnitureCategory getCategory()
Returns the category of this piece of furniture.


equals

public boolean equals(java.lang.Object obj)
Returns true if this piece and the one in parameter have the same name.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns a hash code computed from the name of this piece.

Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(CatalogPieceOfFurniture piece)
Compares the names of this piece and the one in parameter.

Specified by:
compareTo in interface java.lang.Comparable<CatalogPieceOfFurniture>

Sweet Home 3D 3.4

? Copyrights 2006-2011 eTeks - All rights reserved
Distributed under GNU General Public License