# Plan Interaction Handler
# Coordinate System
The coordinate system within the Roomle ConfigurationScript is a left-handed cartesian coordinate system with +Z
as the up vector and +Y
as the forward direction of the model. In the 3d file 1 Model Unit
has to correspond to 1mm
real world size of the object.
Location, orientation and size (bounding box) are stored for each object in a plan.
The position is defined with properties x
, y
and z
, which indicate the bottom center of the object.
The size is defined by the dimensions width
, depth
and height
.
Orientation is defined by a rotation
angle in degrees. The rotation
angle specifies the clockwise rotation around the Z axis.
# Plan object properties
# Level
level | description |
---|---|
0 | undefined |
10 | on the bottom level e.g. rug |
20 | under the table e.g. chair |
30 | equals the table level e.g. table |
40 | on the table e.g. fruit bowl |
43 | 50cm (special) |
45 | 1m (special) |
50 | over the table e.g. hanging lamp |
55 | pictures |
60 | cailing height minus object height |
# Type
(type
)
bath, bed, building, decoration, door, electric, floor, garden, gym, lighting, other, seating, sofa, stair, storage, table, wall, window
# Detail Type
(detailedType
)
accessories, art, bath_accessories, bath_basin, bath_cabinet, bath_electric, bath_shower, bath_spa, bath_tub, bedside_table, bed_bed, bed_kids, bed_linen, bed_loftbed, bed_sofabed, bench, cabinet, carpet, carport, chair, cleaning, container, cupboard, curtain, door, door_double, door_garage, door_sliding, dustbin, electric_other, file_cabinet, garage, garage_storage, garden_barbeque, garden_general, garden_outdoor_plants, garden_seating, garden_sunlounger, garden_sunshade, garden_tables, gym_electric, gym_other, heating, kids_toys, kitchen_accessoires, kitchen_block, kitchen_dishwasher, kitchen_electric, kitchen_fridge, kitchen_oven, kitchen_sink, lamp_ceiling, lamp_other, lamp_outside, lamp_standing, lamp_table, lamp_wall, laundry, living_couch, living_media, mirror, mirror_cabinet, office_accessories, office_chair, office_edv, office_table, other, pet, plant, seating_group, shelf, sideboards, stool, table_table, toilet, wardrobe, watches, window, window_double
# Drawing
- getContinuousDrawingManager: returns the current active ContinuousDrawingManager or null if the current drawing mode is not
Continuous
# Snapping
Objects can be snapped to walls or other objects.
Whether an object is snapped depends on the object's distance to the nearest wall or other objects.
If the distance to the nearest wall or object is below a certain threshold, that will be chosen as the snap target.
Snapping an object only changes the position and orientation of the moved object.
All other objects remain static. Only the bounding boxes of the objects are taken into account when calculating the snap position and orientation.
When an object is snapped to a wall, the back of the object is orientated to the wall.
Other walls also constrain the object's position, which allows the object to be accurately placed in corners of a room.
If an object's target position is on a wall, and an object's catalog level allows the object to be placed on walls, the object's base level is also changed.
Object can only be snapped to object with the same catalog level information.
When snapping to other objects, one side of the object being realigned snaps to one side of the target object.
The object is rotated by the smallest angle that causes the sides to align.
If corners or side centers of the objects are within a certain distance, these points will be snapped.
# Drawing Modes
Currently there are 2 drawing modes available in the planner core: CONTINUOUS
and CLICKDRAWING
# Continuous Drawing
This mode is intended for touch clients where the user draws walls directly by sliding over the interface.
The view should send the current position of the input (aka the finger) to the core via currentDrawingPosition
.
Internally the DrawingManager tries to fit the points to a line, once the stream of points breaks out of the current corridor, the current wall is finished and a new wall is started. At the begining of each wall, the user has a small circle around the starting point where the angle of the next wall can be decided. If not overriden this angle snaps to a multiple of 45 degrees. Once the user leaves the startcircle, the angle is fixed for this wall.
The view can obtain the current instance of the ContinuousDrawingManager via getContinuousDrawingManager
from the PlanInteractionHandler.
This Manager provides access to the information needed to show the internal process to the user:
getDrawnPoints
: the list of points drawn in the current wall till now (points might be filtered by the core)getDrawingAngle
: angle of the current wall/corridorshouldShowCircle
: true if the view should show the starting circle for the wallgetCircleRotation
: the base rotation of the circlegetStartPoint
: specially relevant while showing the circle. this is the center of the circleCIRCLE_RADIUS
: constant of the circle Radius in view units (usually px)