WanaPlan

API Docs for: 2.7.0
Show:

EditMeasureComponent

Extends BaseComponent2D
Module: Component
Parent Module: Wanaplan

Summary

Component allowing to edit 2D Measures when clicking on them.

Constructor

EditMeasureComponent

Syntax

EditMeasureComponent

(
  • core
)

Summary

Parameters:

  • core wnp.Core

    Wanaplan Core.

Methods

destroy

Inherited from BaseComponent2D:

Syntax

destroy

()

Summary

Method called when the component is destroyed

destroyDialog

Syntax

destroyDialog

()

Summary

Destroys the measure edition dialog if it exists

disable

Inherited from BaseComponent2D:

Syntax

disable

()

Summary

Disables the component

displacePoint

Syntax

displacePoint

(
  • target_measure
  • displacement
  • angleWall
  • moveLeftUp
)

Summary

Function that applies the chosen displacement to the chosen measure extremity

Parameters:

  • target_measure MeasureStructure

    measure to modify

  • displacement Number

    amount of displacement to apply (positive or negative)

  • angleWall Number

    the angle of the wall vector with the x horizontal vector

  • moveLeftUp Boolean

    true if we want to move the point that is on the left for a horizonal measure, or on top for a vertical one

enable

Inherited from BaseComponent2D:

Syntax

enable

()

Summary

Enables the component

getSideToMove

Syntax

getSideToMove

(
  • angleWall
  • moveLeftUp
)
Integer private

Summary

Function to find out which side of the wall we want

Parameters:

  • angleWall Number

    the angle of the wall vector p0p1 with the x vector

  • moveLeftUp Boolean

    true if we want the point on the left for a horizonal wall, or up for a vertical one

Returns:

Integer:

Returns 0 or 1 the index of the wanted extremity

getTargeted

Inherited from BaseComponent2D:

Syntax

getTargeted

(
  • vector
)
Object

Summary

Finds out if the given position is over an element handled by the component

Parameters:

  • vector Vector

    A position, usually the cursor's one.

Returns:

Object:

The targeted element, or null if nothing is found.

initialize

Inherited from BaseComponent2D:

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 Event

    The JS event.

onContextChanged

Inherited from BaseComponent2D:

Syntax

onContextChanged

(
  • context
)

Summary

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String
    The new context

startListening

Inherited from BaseComponent2D:

Syntax

startListening

()

Summary

Calls all the event listeners.

stopListening

Inherited from BaseComponent2D:

Syntax

stopListening

()

Summary

Removes all the event listeners.

update

Inherited from BaseComponent2D:

Syntax

update

()

Summary

Generic update method, called on every frame

Properties

name

Inherited from BaseComponent2D:

Syntax

name

String

Summary

Component name

priority

Inherited from BaseComponent2D:

Syntax

priority

Number

Summary

Priority of the component in the "update" and "draw" routines

structure

Inherited from BaseComponent2D:

Syntax

structure

wnp.Structure

Summary

Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is saved