r3-legacy/src/r3-curve-path-d2-shape.js

70 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-04-09 09:35:04 +02:00
/**
2019-07-25 22:22:32 +02:00
* R3.Curve.Path.D2.Shape
* @param parent
* @param apiComponent
* @param linkedObjects
2018-04-09 09:35:04 +02:00
* @constructor
*/
R3.Curve.Path.D2.Shape = function(
2019-07-25 22:22:32 +02:00
parent,
apiComponent,
linkedObjects
2018-04-09 09:35:04 +02:00
) {
2019-07-25 22:22:32 +02:00
if (R3.Utils.UndefinedOrNull(linkedObjects)) {
2018-04-09 09:35:04 +02:00
2019-07-25 22:22:32 +02:00
/**
* This class behaves in such a way that we can create instances from it - we define the runtime and construct
* the api object and upgrade its properties to runtime
*/
2018-04-09 09:35:04 +02:00
2019-07-25 22:22:32 +02:00
__RUNTIME_COMPONENT_MACRO__;
R3.API.Curve.Path.D2.Shape.call(
this,
apiComponent
);
} else {
/**
* This class was inherited and Component constructor will call the child class createInstance()
* Add any more linking information to the linkedObjects object here
*/
}
2018-04-09 09:35:04 +02:00
2019-07-25 22:22:32 +02:00
/**
* Now we call the parent class but with linkedObjects - indicating that its being called from a child class
* and should not do any runtime instantiation
*/
2018-04-09 09:35:04 +02:00
R3.Curve.Path.D2.call(
this,
2019-07-25 22:22:32 +02:00
parent,
apiComponent,
linkedObjects
)
2018-04-09 09:35:04 +02:00
};
R3.Curve.Path.D2.Shape.prototype = Object.create(R3.Curve.Path.D2.prototype);
R3.Curve.Path.D2.Shape.prototype.constructor = R3.Curve.Path.D2.Shape;
/**
* Creates a camera instance
* @returns {*}
*/
R3.Curve.Path.D2.Shape.prototype.createInstance = function() {
2019-07-25 22:22:32 +02:00
this.instance = this.graphics.Shape(this.points);
2018-04-09 09:35:04 +02:00
2019-07-25 22:22:32 +02:00
R3.Component.prototype.createInstance.call(this);
2018-04-09 09:35:04 +02:00
};
/**
* Updates the instance with the current state
*/
R3.Curve.Path.D2.Shape.prototype.updateInstance = function(property) {
R3.Curve.Path.D2.prototype.updateInstance.call(this, property);
};