Class: TextBoxMarkupItem

TextBoxMarkupItem(textBoxManager, firstPoint, config)

This class represents a single textbox markup element.

Constructor

new TextBoxMarkupItem(textBoxManager, firstPoint, config)

Creates a new TextBoxManager object

Parameters:
Name Type Description
textBoxManager TextBoxManager

The manager that will own this markup item

firstPoint Point3

The position of insertion point on the model

config Object

Text Box Configuration: secondPoint - The position of the textbox in relation to the insertion point
secondPointRel - A normalized 2D point that is used if the position of the textbox is fixed
fontStyle - The font used for the textbox text
fontSize - The font size used for the textbox text
backgroundColor - The background color of the textbox
circleColor - The color of the circle that is rendered at the insertion point
circleRadius - The radius of the circle that is rendered at the insertion point
maxWidth - The maximum width of the textbox
fixed - If true, the textbox will be fixed in position
extraDiv - Extra div text to be added to the textbox
uniqueid - Id of Markup Element
userdata - User data to be stored with the markup element
checkVisibility - If true, the textbox will be hidden if the insertion point is not visible
showLeaderLine - If true, the textbox will have a leader line
hasPin - If true, the textbox will have a 3d pin object allowFirstPointMove - If true, the insertion point can be moved allowSecondPointMove - If true, the textbox can be moved

Classes

TextBoxMarkupItem

Methods

(static) fromJson(textBoxManager, json) → {TextBoxMarkupItem}

Creates a markup item from a previously serialized JSON object

Parameters:
Name Type Description
textBoxManager TextBoxManager

The manager that will own this markup item

json json

The JSON object to deserialize

Returns:

Markup Item

Type
TextBoxMarkupItem

deselect()

Deselects the markup

destroy()

Deletes the markup

getAllowEditing() → {boolean}

Retrieves the markup's allow editing state

Returns:
  • True if text editing is allowed, false otherwise
Type
boolean

getAllowFirstPointMove() → {boolean}

Returns true if first point can be moved

Returns:
  • True if first point can be moved, false otherwise
Type
boolean

getAllowSecondPointMove() → {boolean}

Returns true if second point can be moved

Returns:
  • True if second point can be moved, false otherwise
Type
boolean

getCheckVisibility() → {boolean}

Retrieves the markup's check visibility state

Returns:
  • True if the markup will be hidden if the insertion point is not visible, false otherwise
Type
boolean

getExtraDiv() → {object}

Returns the markups extra div (if any)

Returns:
  • The extra div
Type
object

getFirstPoint() → {Point3}

Retrieves the position of the insertion point

Returns:

Insertion point

Type
Point3

getFixed() → {boolean}

Returns the markups fixed state

Returns:
  • True if the markup is fixed, false otherwise
Type
boolean

getHidden() → {boolean}

Retrieves the markup's hidden state

Returns:
  • True if the markup is hidden, false otherwise
Type
boolean

getSecondPoint() → {Point3}

Retrieves the position of the text box

Returns:

Text Box Position

Type
Point3

getSelected() → {boolean}

Retrieves the markup's selected state

Returns:
  • True if the markup is selected, false otherwise
Type
boolean

getUniqueId() → {guid}

Retrieves the markup's unique id

Returns:
  • The markup's unique id
Type
guid

getUserData() → {json}

Retrieves the markup's user data

Returns:
  • The markup's user data
Type
json

hide()

Hides the markup (if visible)

isPinGeometry(nodeid) → {boolean}

Determines if the provided nodeid is part of the note-pin geometry

Parameters:
Name Type Description
nodeid nodeid

Node Id

Returns:
  • True if the nodeid is part of the note-pin geometry, false otherwise
Type
boolean

select()

Selects the markup

setAllowEditing(allow)

Sets if text editing is allowed

Parameters:
Name Type Description
allow boolean

True if text editing is allowed, false otherwise

setBackgroundColor(color)

Sets the markup's background color

Parameters:
Name Type Description
color Color

The color to set

setCheckVisibility(check)

Sets if the markup should be hidden if the insertion point is not visible

Parameters:
Name Type Description
check boolean

True if the markup should be hidden if the insertion point is not visible

setCircleColor(color)

Sets the markup's circle color

Parameters:
Name Type Description
color Color

The color to set

setFirstPoint(point)

Sets the position of insertion point on the model

Parameters:
Name Type Description
point Point3

The position of the insertion point

setFixed(fixed)

Sets the markup's fixed state

Parameters:
Name Type Description
fixed boolean

True if the markup is fixed, false otherwise

setSecondPoint(point)

Sets the position of the textbox in relation to the insertion point

Parameters:
Name Type Description
point Point3

The position of the textbox

setText(text)

Sets the markup's text

Parameters:
Name Type Description
text text

The text to set

show()

Shows the markup (if hidden)

toJson() → {json}

Returns a json representation of the markup

Returns:
  • The json representation of the markup
Type
json