Joined: Jul 26, 2011
Post Count: 62
Status:
Offline
Get the list of Piece of Furniture that is displayed in the panel
Hello community,
I think I have a rather easy question. I have this code somewhere in my program
for (HomePieceOfFurniture piece : home.getFurniture()) { if (piece.isVisible()) { i++; }}
which I used in order to get the furniture that is visible in my room. The thing is that if some pieces are displayed twice, "i" doesn't count them, which is logical. How can I get the list of the furniture that are displayed in the panel which is placed in the bottom left corner in SH3D?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Get the list of Piece of Furniture that is displayed in the panel
Each piece displayed in the home has a matching HomePieceOfFurniture instance even if it uses more than once a model in the catalog. Thus, your loop looks ok.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator