EditMeasureComponent
Summary
Component allowing to edit 2D Measures when clicking on them.
Constructor
EditMeasureComponent
Syntax
EditMeasureComponent
-
core
Summary
Parameters:
-
core
wnp.CoreWanaplan Core.
Item Index
Methods
Methods
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddestroyDialog
Syntax
destroyDialog
()
Summary
Destroys the measure edition dialog if it exists
disable
Syntax
disable
()
Summary
Disables the componentdisplacePoint
Syntax
displacePoint
-
target_measure
-
displacement
-
angleWall
-
moveLeftUp
Summary
Function that applies the chosen displacement to the chosen measure extremity
Parameters:
-
target_measure
MeasureStructuremeasure to modify
-
displacement
Numberamount of displacement to apply (positive or negative)
-
angleWall
Numberthe angle of the wall vector with the x horizontal vector
-
moveLeftUp
Booleantrue if we want to move the point that is on the left for a horizonal measure, or on top for a vertical one
enable
Syntax
enable
()
Summary
Enables the componentgetSideToMove
Syntax
getSideToMove
-
angleWall
-
moveLeftUp
Summary
Function to find out which side of the wall we want
Parameters:
Returns:
Returns 0 or 1 the index of the wanted extremity
getTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.onClick
Syntax
onClick
-
event
Summary
Destroys the measure edition dialog if click outside the dialog And opens the measure edition dialog if click on a measure Triggered on event click
Parameters:
-
event
EventThe JS event.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context