Class PinSupport
represents pin support
Defined in: raphaelsm.src.js.
Constructor Attributes | Constructor Name and Description |
---|---|
PinSupport(raphael, params)
Pin support
|
Field Attributes | Field Name and Description |
---|---|
angle of the object
|
|
cos of this.angle
|
|
actual raphael object
|
|
svg array (list) of the object
|
|
raphael instance connected to the object
|
|
width/height of the pin
|
|
sin of this.angle
|
|
size of the object
|
|
true for sliding pins and false for fixed pins
|
|
x coordinate of the object
|
|
z coordinate of the object
|
Method Attributes | Method Name and Description |
---|---|
constructorPinSupport(raphael, params)
Constructor, see PinSupport for parameters description
|
|
<static> |
PinSupport.create(raphael, params)
Creates new PinSupport object, for parameters meaning see PinSupport
|
makeCopy()
Returns copy of receiver
|
|
rotate(phi)
Rotate receiver by given angle (this.angle += phi)
|
|
setAngle(phi)
Set angle of receiver (this.angle = phi)
|
|
Sets svg path of receiver
|
|
setX(x)
Sets new x position of receiver (this.x = x)
|
|
setXZ(x, z)
Sets new x and z position of receiver (this.x = x; this.z = z)
|
|
setZ(z)
Sets new z position of receiver (this.z = z)
|
|
translate(dx, dz)
Translate receiver in x and z direction (this.x += dx; this.z += dz)
|
|
translateX(dx)
Translate receiver in x direction (this.x += x)
|
|
translateZ(dz)
Translate receiver in x direction (this.z += dz)
|
|
up()
Update receiver (set this.pathList for given internal variables - x,z,angle.
|
Class Detail
PinSupport(raphael, params)
Pin support
- Parameters:
- {Raphael} raphael
- raphael instance
- {Object} params
- parameters, see below
- {float} params.x Optional, Default: 0.
- x coordinate of supprt tip [pixel]
- {float} params.z Optional, Default: 0.
- z coordinate of supprt tip [pixel]
- {float} params.size Optional, Default: 20.
- height of the support [pixel]
- {float} params.angle Optional, Default: 0.
- the support will be rotated by angle [deg]
- {bool|int} params.sliding Optional, Default: true
- if the support is sliding or not
- {float} params.gap Optional, Default: 5.
- gap between triangle and line (sliding symbol) [pixel]
- {float} params.ratio Optional, Default: 0.7
- width/height of the triangle [-]
Field Detail
angle
angle of the object
cos
cos of this.angle
obj
actual raphael object
pathList
svg array (list) of the object
raphael
raphael instance connected to the object
{float}
ratio
width/height of the pin
sin
sin of this.angle
size
size of the object
{bool}
sliding
true for sliding pins and false for fixed pins
x
x coordinate of the object
z
z coordinate of the object
Method Detail
constructorPinSupport(raphael, params)
Constructor, see PinSupport for parameters description
- Parameters:
- raphael
- params
<static>
{PinSupport}
PinSupport.create(raphael, params)
Creates new PinSupport object, for parameters meaning see PinSupport
- Parameters:
- raphael
- params
- Returns:
- {PinSupport} new PinSupport object
{PinSupport}
makeCopy()
Returns copy of receiver
- Returns:
- {PinSupport} copy of receiver
rotate(phi)
Rotate receiver by given angle (this.angle += phi)
- Parameters:
- {float} phi
- angle of rotation
setAngle(phi)
Set angle of receiver (this.angle = phi)
- Parameters:
- {float} phi
- angle of rotation
setPathList()
Sets svg path of receiver
setX(x)
Sets new x position of receiver (this.x = x)
- Parameters:
- {float} x
- new x coordinate [pixel]
setXZ(x, z)
Sets new x and z position of receiver (this.x = x; this.z = z)
- Parameters:
- {float} x
- new x coordinate [pixel]
- {float} z
- new z coordinate [pixel]
setZ(z)
Sets new z position of receiver (this.z = z)
- Parameters:
- {float} z
- new z coordinate [pixel]
translate(dx, dz)
Translate receiver in x and z direction (this.x += dx; this.z += dz)
- Parameters:
- {float} dx
- distance to be translated in x direction [pixel]
- {float} dz
- distance to be translated in z direction [pixel]
translateX(dx)
Translate receiver in x direction (this.x += x)
- Parameters:
- {float} dx
- distance to be translated [pixel]
translateZ(dz)
Translate receiver in x direction (this.z += dz)
- Parameters:
- {float} dz
- distance to be translated [pixel]
up()
Update receiver (set this.pathList for given internal variables - x,z,angle... - as well as its copies)